HFP allows the car head unit to communicate with mobile phones in the car.
To connect via HFP, simply send the connect_service command with the MAC address as the data parameter and the profile number (0x111E) 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::0x111E" >> /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.
With the HFP profile, you can initiate a call, accept an incoming call, or terminate an active call.
To perform any of these actions, you must write the appropriate command (e.g., HFP_CALL) to the /pps/services/bluetooth/handsfree/control object.
You can read the /pps/services/handsfree/status object to learn the outcome of the last HFP command and the call state of the paired mobile device. This last field tells you if the device's phone line is idle or in use and if a call is on hold, being initialized, or already 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::0x111E" >> /pps/services/bluetooth/control