MT2523 API Reference  LinkIt SDK v4

The Phonebook Access Profile (PBAP) defines the protocols and procedures to exchange phonebook objects between two peer devices. More...

Overview

The Phonebook Access Profile (PBAP) defines the protocols and procedures to exchange phonebook objects between two peer devices.

PBAP client (PBAPC) is implemented for the client side connection according to the PBAP specification. It can initiate a connection to a remote device. The API provides the following functionalities, such as get the number of phonebook objects, get the phonebook objects, get the caller's name by the phone number and more. Note: It only supports access to phonebook objects storaged in Phone, not support in SIM.

How to use this module

Functions

bt_status_t bt_pbapc_connect (uint32_t *handle, const bt_bd_addr_t *address)
 This function connects to the specified remote device. More...
 
bt_status_t bt_pbapc_get_num_of_phonebook_objects (uint32_t handle, bt_pbapc_phonebook_type_t type)
 This function gets the number of phonebook objects of type Missed Calls History or Main Phonebook of the specified remote device. More...
 
bt_status_t bt_pbapc_get_phonebook_objects (uint32_t handle, uint16_t offset, bt_pbapc_phonebook_type_t type)
 This function gets the phonebook objects of type Missed Calls History or Main Phone Book of the specified remote device. More...
 
bt_status_t bt_pbapc_get_caller_name_by_number (uint32_t handle, uint8_t *number)
 This function gets the contact name of a phonebook object stored in the phonebook of the remote device. More...
 
bt_status_t bt_pbapc_pull_vcard_entry (uint32_t handle, uint8_t index)
 This function pulls a specific vCard object from the specified remote device. More...
 
bt_status_t bt_pbapc_disconnect (uint32_t handle)
 This function disconnects from the specified remote device. More...
 

Modules

 Define
 
 Struct
 

Function Documentation

bt_status_t bt_pbapc_connect ( uint32_t *  handle,
const bt_bd_addr_t address 
)

This function connects to the specified remote device.

BT_PBAPC_CONNECT_CNF event is sent to the upper layer with the connection result.

Parameters
[out]handleis the identifier of the remote device.
[in]addressis the Bluetooth address of the remote device.
Returns
BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed. BT_STATUS_OUT_OF_MEMORY, out of memory.
bt_status_t bt_pbapc_disconnect ( uint32_t  handle)

This function disconnects from the specified remote device.

BT_PBAPC_DISCONNECT_IND event is sent to the upper layer with the result of the disconnection.

Parameters
[in]handleis the identifier of the remote device.
Returns
BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed. BT_STATUS_OUT_OF_MEMORY, out of memory.
bt_status_t bt_pbapc_get_caller_name_by_number ( uint32_t  handle,
uint8_t *  number 
)

This function gets the contact name of a phonebook object stored in the phonebook of the remote device.

The BT_PBAPC_GET_CALLER_NAME_IND and BT_PBAPC_GET_CALLER_NAME_CNF events are sent to the upper layer with the connection result.

Parameters
[in]handleis the identifier of the remote device.
[in]numberis the telephone number, if it is null, the result is the number of phonebook objects stored in the phone.
Returns
BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed. BT_STATUS_OUT_OF_MEMORY, out of memory.
bt_status_t bt_pbapc_get_num_of_phonebook_objects ( uint32_t  handle,
bt_pbapc_phonebook_type_t  type 
)

This function gets the number of phonebook objects of type Missed Calls History or Main Phonebook of the specified remote device.

The BT_PBAPC_GET_NUMBER_OF_PHOENBOOK_OBJECTS_IND & BT_PBAPC_GET_NUMBER_OF_PHOENBOOK_OBJECTS_CNF event is sent to the upper layer with the connection result.

Parameters
[in]handleis the identifier of the remote device.
[in]typeis the type of phonebook objects.
Returns
BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed. BT_STATUS_OUT_OF_MEMORY, out of memory.
bt_status_t bt_pbapc_get_phonebook_objects ( uint32_t  handle,
uint16_t  offset,
bt_pbapc_phonebook_type_t  type 
)

This function gets the phonebook objects of type Missed Calls History or Main Phone Book of the specified remote device.

BT_PBAPC_GET_PHOENBOOK_OBJECTS_IND and BT_PBAPC_GET_PHONEBOOK_OBJECTS_CNF events are sent to the upper layer with the connection result.

Parameters
[in]handleis the identifier of the remote device.
[in]offsetis the start offset.
[in]typeis the type of phonebook objects.
Returns
BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed. BT_STATUS_OUT_OF_MEMORY, out of memory.
bt_status_t bt_pbapc_pull_vcard_entry ( uint32_t  handle,
uint8_t  index 
)

This function pulls a specific vCard object from the specified remote device.

The BT_PBAPC_GET_PHOENBOOK_OBJECTS_IND and BT_PBAPC_GET_PHONEBOOK_OBJECTS_CNF events are sent to the upper layer with the connection result.

Parameters
[in]handleis the identifier of the remote device.
[in]indexis the index of phonebook objects.
Returns
BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed. BT_STATUS_OUT_OF_MEMORY, out of memory.