dotstack API Reference
1.10.37
|
The Phone Book Access Profile (PBAP) defines the protocols and procedures that shall be used by devices for the retrieval of phone book objects. More...
Macros | |
#define | bt_pbap_get_phonebook_size(session, pb_type) bt_pbap_pull_phonebook(session, pb_type, 0, 0, 0, 0) |
Get a phonebook's size. More... | |
#define | bt_pbap_pull_vcard_listing_all(session, pb_type, order) bt_pbap_pull_vcard_listing(session, pb_type, order, 0, NULL, 0, 0xFFFF, 0) |
Pull a vCard listing from a remote device. More... | |
#define | bt_pbap_get_vcard_listing_size(session, pb_type) bt_pbap_pull_vcard_listing(session, pb_type, 0, 0, NULL, 0, 0, 0) |
Get the size of a vCard listing from a remote device. More... | |
Functions | |
bt_bool | bt_pbap_init (void) |
Initialize the PBAP layer. More... | |
bt_pbap_session_t * | bt_pbap_allocate_session (void) |
Allocate PBAP session. More... | |
void | bt_pbap_free_session (bt_pbap_session_t *psess) |
Release PBAP session. More... | |
bt_bool | bt_pbap_connect (bt_pbap_session_t *session, bt_bdaddr_t *remote_addr, bt_uint header_count, bt_obex_header *headers, bt_pbap_session_callback_pf callback, void *param) |
Connect to a remote device. More... | |
bt_bool | bt_pbap_connect_ex (bt_pbap_session_t *session, bt_bdaddr_t *pbdaddr_remote, bt_byte server_channel, bt_uint header_count, bt_obex_header *headers, bt_pbap_session_callback_pf callback, void *param) |
Connect to a remote device. More... | |
bt_bool | bt_pbap_disconnect (bt_pbap_session_t *session) |
Disconnect from a remote device. More... | |
bt_bool | bt_pbap_disconnect_ex (bt_pbap_session_t *session, bt_uint header_count, bt_obex_header *headers) |
Disconnect from a remote device. More... | |
void | bt_pbap_set_vcard_buffer (bt_pbap_session_t *session, bt_vcard *buffer, bt_uint buffer_size) |
Sets a pointer to a vCard buffer. More... | |
bt_bool | bt_pbap_pull_phonebook (bt_pbap_session_t *session, bt_byte pb_type, bt_ulong filter, bt_byte format, bt_uint max_list_count, bt_uint list_start_offset) |
Pull a phonebook from a remote device. More... | |
bt_bool | bt_pbap_pull_vcard_listing (bt_pbap_session_t *session, bt_byte pb_type, bt_byte order, bt_byte search_attr, bt_byte *search_value, bt_byte search_value_len, bt_uint max_list_count, bt_uint list_start_offset) |
Pull a vCard listing from a remote device. More... | |
bt_bool | bt_pbap_pull_vcard (bt_pbap_session_t *session, bt_byte pb_type, bt_byte *vcard_name, bt_byte vcard_name_len, bt_ulong filter, bt_byte format) |
Pull a vCard from a remote device. More... | |
bt_bool | bt_pbap_login (bt_pbap_session_t *session, const obex_auth_challenge_t *challenge, const bt_char *password) |
Authenticate PBAP session. More... | |
bt_bool | bt_pbap_abort (bt_pbap_session_t *session) |
Close PBAP session. More... | |
bt_hci_conn_state_t * | bt_pbap_get_hci_connection (const bt_pbap_session_t *session) |
Get PBAP session underlying HCI connection. More... | |
The Phone Book Access Profile (PBAP) defines the protocols and procedures that shall be used by devices for the retrieval of phone book objects.
#define bt_pbap_get_phonebook_size | ( | session, | |
pb_type | |||
) | bt_pbap_pull_phonebook(session, pb_type, 0, 0, 0, 0) |
Get a phonebook's size.
This function gets the size of a phonebook from a remote device.
session | PBAP session. |
pb_type | Phonebook type to pull. |
TRUE
if the function succeeds. FALSE
otherwise. #define bt_pbap_get_vcard_listing_size | ( | session, | |
pb_type | |||
) | bt_pbap_pull_vcard_listing(session, pb_type, 0, 0, NULL, 0, 0, 0) |
Get the size of a vCard listing from a remote device.
This function gets the size of a vCard listing from a remote device.
session | PBAP session. |
pb_type | Phonebook type to pull. |
TRUE
if the function succeeds. FALSE
otherwise. #define bt_pbap_pull_vcard_listing_all | ( | session, | |
pb_type, | |||
order | |||
) | bt_pbap_pull_vcard_listing(session, pb_type, order, 0, NULL, 0, 0xFFFF, 0) |
Pull a vCard listing from a remote device.
This function pulls a vCard listing from a remote device that contains all vCards. Received vCards are reported to an app via PBAP session callback with PBAP_EVT_SESSION_PHONEBOOK_ENTRY event.
session | PBAP session. |
pb_type | Phonebook type to pull. |
order | Sort order. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_pbap_abort | ( | bt_pbap_session_t * | session | ) |
Close PBAP session.
This function closes PBAP session with a remote device.
session | PBAP session. |
TRUE
if the function succeeds. FALSE
otherwise. bt_pbap_session_t* bt_pbap_allocate_session | ( | void | ) |
Allocate PBAP session.
This function allocates new PBAP session.
NULL
otherwise. bt_bool bt_pbap_connect | ( | bt_pbap_session_t * | session, |
bt_bdaddr_t * | remote_addr, | ||
bt_uint | header_count, | ||
bt_obex_header * | headers, | ||
bt_pbap_session_callback_pf | callback, | ||
void * | param | ||
) |
Connect to a remote device.
This function establishes a PBAP connection with a remote device which is running PBAP server. Changes in the session state are reported through a callback
function.
session | PBAP session. |
remote_addr | Address of the remote device. |
header_count | The number of optional OBEX headers sent with the connect request. |
headers | Optional OBEX headers sent with the connect request. |
callback | The callback function that will be called when the PBAP generates an event. |
param | A pointer to arbitrary data to be passed to the callback function. |
TRUE
if the function succeeds. FALSE
otherwise. The callback function is not called in this case. bt_bool bt_pbap_connect_ex | ( | bt_pbap_session_t * | session, |
bt_bdaddr_t * | pbdaddr_remote, | ||
bt_byte | server_channel, | ||
bt_uint | header_count, | ||
bt_obex_header * | headers, | ||
bt_pbap_session_callback_pf | callback, | ||
void * | param | ||
) |
Connect to a remote device.
This function establishes a PBAP connection with a remote device which is running PBAP server. Changes in the session state are reported through a callback
function.
session | PBAP session. |
remote_addr | Address of the remote device. |
server_channel | RFCOMM server channel to connect to. |
header_count | The number of optional OBEX headers sent with the connect request. |
headers | Optional OBEX headers sent with the connect request. |
callback | The callback function that will be called when the PBAP generates an event. |
param | A pointer to arbitrary data to be passed to the callback function. |
TRUE
if the function succeeds. FALSE
otherwise. The callback function is not called in this case. bt_bool bt_pbap_disconnect | ( | bt_pbap_session_t * | session | ) |
Disconnect from a remote device.
This function closes a PBAP connection with a remote device. Changes in the session state are reported through a callback function set in bt_pbap_connect call.
session | PBAP session. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_pbap_disconnect_ex | ( | bt_pbap_session_t * | session, |
bt_uint | header_count, | ||
bt_obex_header * | headers | ||
) |
Disconnect from a remote device.
This function closes a PBAP connection with a remote device. Changes in the session state are reported through a callback function set in bt_pbap_connect call.
session | PBAP session. |
header_count | The number of optional OBEX headers sent with the disconnect request. |
headers | Optional OBEX headers sent with the disconnect request. |
TRUE
if the function succeeds. FALSE
otherwise. void bt_pbap_free_session | ( | bt_pbap_session_t * | psess | ) |
Release PBAP session.
This function deallocated the specified PBAP session. This function does not disconnect the session. It just frees the memory used by the bt_pbap_session_t structure. The session has to be disconnected by a remote device or by calling bt_pbap_disconnect.
session | The PBAP session to be deallocated. |
bt_hci_conn_state_t* bt_pbap_get_hci_connection | ( | const bt_pbap_session_t * | session | ) |
Get PBAP session underlying HCI connection.
This function returns PBAP session underlying HCI connection.
session | PBAP session. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_pbap_init | ( | void | ) |
Initialize the PBAP layer.
This function initializes the PBAP layer of the stack. It must be called prior to any other PBAP function is called.
bt_bool bt_pbap_login | ( | bt_pbap_session_t * | session, |
const obex_auth_challenge_t * | challenge, | ||
const bt_char * | password | ||
) |
Authenticate PBAP session.
This function authenticates PBAP session with a remote device.
session | PBAP session. |
challenge | Callnage received from a remote device in PBAP_EVT_SESSION_AUTH_REQUESTED event. |
password | Password ("0000") |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_pbap_pull_phonebook | ( | bt_pbap_session_t * | session, |
bt_byte | pb_type, | ||
bt_ulong | filter, | ||
bt_byte | format, | ||
bt_uint | max_list_count, | ||
bt_uint | list_start_offset | ||
) |
Pull a phonebook from a remote device.
This function pulls a phonebook from a remote device. VCARDs are stored in bt_pbap_session::vcard_list.
session | PBAP session. |
pb_type | Phonebook type to pull. |
filter | A bitmmask that defines witch vCard attributes to pull. |
format | The format of vCard to return. |
max_list_count | The maximum number of vCards to return. |
list_start_offset | The first vCard to return. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_pbap_pull_vcard | ( | bt_pbap_session_t * | session, |
bt_byte | pb_type, | ||
bt_byte * | vcard_name, | ||
bt_byte | vcard_name_len, | ||
bt_ulong | filter, | ||
bt_byte | format | ||
) |
Pull a vCard from a remote device.
This function pulls a vCard from a remote device. The vCard is stored in bt_pbap_session::vcard_list.
session | PBAP session. |
pb_type | Phonebook type to pull. |
vcard_name | vCard name |
vcard_name_len | The length of the vCard name |
filter | A bitmmask that defines witch vCard attributes to pull. |
format | The format of vCard to return. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_pbap_pull_vcard_listing | ( | bt_pbap_session_t * | session, |
bt_byte | pb_type, | ||
bt_byte | order, | ||
bt_byte | search_attr, | ||
bt_byte * | search_value, | ||
bt_byte | search_value_len, | ||
bt_uint | max_list_count, | ||
bt_uint | list_start_offset | ||
) |
Pull a vCard listing from a remote device.
This function pulls a vCard listing from a remote device. Received vCards are reported to an app via PBAP session callback with PBAP_EVT_SESSION_PHONEBOOK_ENTRY event.
session | PBAP session. |
pb_type | Phonebook type to pull. |
order | Sort order. |
search_attr | The Id of a vCard attribute which is used to filter the listing. |
search_value | The value of a vCard attribute which is used to filter the listing. Optional. |
search_value_len | The length of the value of a vCard attribute which is used to filter the listing. Not used if search_value is NULL. |
max_list_count | The maximum number of VACRDs to return. |
list_start_offset | The first vCard to return. |
TRUE
if the function succeeds. FALSE
otherwise. void bt_pbap_set_vcard_buffer | ( | bt_pbap_session_t * | session, |
bt_vcard * | buffer, | ||
bt_uint | buffer_size | ||
) |
Sets a pointer to a vCard buffer.
This function sets a pointer to a buffer that stores VCARDs received from a remote device.
session | PBAP session. |
buffer | The vCard buffer. |
buffer_size | The number of vCards that can be stored in the buffer. |