The Hands-Free Profile (HFP) defines the minimum set of functions such that a mobile phone can be used in conjunction with a Hands-Free device, with a Bluetooth link providing a wireless means for both remote control of the mobile phone by the Hands-Free device and voice connection between the mobile phone and the Hands-Free device.
More...
The Hands-Free Profile (HFP) defines the minimum set of functions such that a mobile phone can be used in conjunction with a Hands-Free device, with a Bluetooth link providing a wireless means for both remote control of the mobile phone by the Hands-Free device and voice connection between the mobile phone and the Hands-Free device.
The following roles are defined for this profile. Audio Gateway (AG). A device that acts as a gateway of the audio, both for input and output. Typical devices acting as AGs are cellular phones. Hands-Free unit (HF). A device that acts as the AG's remote audio input and output. It also provides remote control means.
- Supported profile version. 1.6
- Supported role. Hands-free unit.
- Supported features:
- Call waiting and 3-way calling.
- CLI presentation capability.
- Voice recognition activation.
- Remote volume control.
- Enhanced call status.
- Enhanced call control.
- Codec negotiation.
Terms and Acronyms
| Terms | Details |
| BATTCHG | Battery Charge indicator of AG to provide the battery level. |
| BRSF | Bluetooth Retrieve Supported Features. |
| SYNC | Synchronization. |
| MIC | Microphone. |
| DTMF | Dual Tone Multi-Frequency, is an in-band telecommunication signaling system using the voice-frequency band over telephone lines. For more information, please refer to Dual tone multi-frequency signaling in Wikipedia. |
| AG | Audio Gateway, the remote device. |
| NREC | Noise Reduction and Echo Canceling, the feature to disable or enable in AG. |
| WBS | Wide Band Speech. |
| CLI | Calling Line Identification, the feature to disable or enable in AG. |
| DIR | Director, the call's director, an attribute of a call. |
| HFP | Hands-Free Profile. For more information, please refer to Hands-free profile in Wikipedia. |
| CVSD | Continuously Variable Slope Delta modulation, a codec of audio. For more information, please refer to Continuously variable slope delta modulation in Wikipedia. |
| MSBC | Modified Sub Band Codec, a codec of audio. |
| CHLD | Call Hold, the 3-way call action in AG. |
| ISDN | Integrated Services Digital Network. For more information, please refer to Integrated services digital network in Wikipedia. |
| FAX | Facsimile. |
| SLC | Service Level Connection, the HFP connection with status negotiation. |
How to use this module
This section presents the HFP connection handle and the method to send the command to dial a number.
- 1. Mandatory, implement bt_app_event_callback() to handle the HFP events, such as connect, disconnect, indication and more.
- Sample code:
{
switch (event_id)
{
{
break;
}
default:
{
break;
}
}
}
- 2. Mandatory, implement the initialization callback bt_hfp_get_init_params().
- 3. Mandatory, connect to the remote device, as shown in figure titled as "HFP connection establishment message sequence" in the Bluetooth developer's guide under the [sdk_root]/doc folder.
- 4. Optional, after receiving the event BT_HFP_SLC_CONNECTED_IND, call the API bt_hfp_send_command() to send a command to dial a number, such as 'ATDXXXX', 'ATD>XXX', 'AT+BLDN', as shown in figure titled as "Initiate an outgoing voice call message sequence" in the Bluetooth developer's guide under the [sdk_root]/doc folder.
- Sample code:
uint8_t hfp_cmd[7] = "ATD114";
- 5. Mandatory, activate the audio link after the BT_HFP_AUDIO_CONNECT_IND event is received. The application needs to activate the audio link status, as shown in figure titled as "HFP connection release message sequence" in the Bluetooth developer's guide under the [sdk_root]/doc folder.
- 6. Mandatory, disconnect the remote device, as shown in figure titled as "HFP connection release message sequence" in the Bluetooth developer's guide under the [sdk_root]/doc folder.
|
| | Define |
| | This section defines the HFP events and error codes.
|
| |
| | Struct |
| | This section defines data structures for the HFP.
|
| |
This function transfers the audio direction to AG or to HF.
- Parameters
-
| [in] | handle | is the handle of the current connection. |
| [in] | audio_dir | is the switch direction, either to AG or HF, please refer to bt_hfp_audio_direction_t. |
- Returns
- BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed.
| bt_status_t bt_hfp_connect_response |
( |
uint32_t |
handle, |
|
|
bool |
accept |
|
) |
| |
This function responds to a connection request from AG.
Calll this API to accept or reject the connection, when BT_HFP_CONNECT_REQUEST_IND is received.
- Parameters
-
| [in] | handle | is the handle of the current connection. |
| [in] | accept | is the operation of accepting or rejecting the current connection request. |
- Returns
- BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed.
This function sends a HFP disconnect request to AG.
The event BT_HFP_DISCONNECT_IND returns the current request’s result.
- Parameters
-
| [in] | handle | is the handle of the current connection. |
- Returns
- BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed.
| bt_bd_addr_t* bt_hfp_get_bd_addr_by_handle |
( |
uint32_t |
handle | ) |
|
This function gets the remote device's Bluetooth address of current connection.
- Parameters
-
| [in] | handle | is the handle of the current connection. |
- Returns
- The Bluetooth address.
This function gets the initialization settings.
This API invoked by the SDP process should be implemented by the application.
- Parameters
-
| [out] | init_params | is the settings to initialize. |
- Returns
- BT_STATUS_SUCCESS, the operation completed successfully, otherwise it failed.
| bt_status_t bt_hfp_send_command |
( |
uint32_t |
handle, |
|
|
uint8_t * |
command, |
|
|
uint16_t |
command_length |
|
) |
| |
This function sends an HFP command to the AG.
The event BT_HFP_ACTION_CMD_CNF returns when the remote device responds.
- Parameters
-
| [in] | handle | is the handle of the current connection. |
| [in] | command | is the command to send. |
| [in] | command_length | is the command's length. |
- Returns
- BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed. BT_STATUS_OUT_OF_MEMORY, out of memory.
This function sets the current audio connection status.
- Parameters
-
| [in] | handle | is the handle of the current connection. |
| [in] | status | is the audio status to set. |
- Returns
- BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed.