PBAP supports the exchange of Phone Book Objects between devices.
The PBAP profile allows you to sync the contact information on the remote device with the head unit's Bluetooth system. PBAP automatically downloads the call history (log of incoming calls, outgoing calls, and missed calls) when the mobile phone is first connected.
To connect via PBAP, simply send the connect_service command with the MAC address as the data parameter and the profile number (0x1130) as data2 to the /pps/services/bluetooth/control object. For example:
echo "command::connect_service\n data::BA:C3:32:AD:55:CC\n data2::0x1130" >> /pps/services/bluetooth/control
In response to commands sent to the control object, the Bluetooth Manager publishes appropriate events (e.g., BTMGR_EVENT_CONNECT_ALL_SUCCESS) in the /pps/services/bluetooth/status object.
The profile allows you to send it one command: SYNC_START. This command will erase the database and repopulate it with fresh data received from the device.
To perform this action, you must write the command to the /pps/services/bluetooth/phonebook/control object.
You can read the /pps/services/bluetooth/phonebook/status object to know whether a particular device is connected, whether any error occurred during a connection attempt, and so on.
The following diagram shows the interactions involving the HMI, PPS, and PBAP:
An automated initiator program (bluetooth-pbap-initiator) will sync the PBAP profile before its state will transition to connected.
To disconnect, simply send the disconnect_service command using the same parameters you used to connect. For example:
echo "command::disconnect_service\n data::BA:C3:32:AD:55:CC\n data2::0x1130" >> /pps/services/bluetooth/control