MT2523 API Reference  LinkIt SDK v4

This section introduces the Advanced Audio Distribution Profile (A2DP) APIs including terms, supported features and details on how to use the APIs to set up a Bluetooth Audio instance. More...

Overview

This section introduces the Advanced Audio Distribution Profile (A2DP) APIs including terms, supported features and details on how to use the APIs to set up a Bluetooth Audio instance.

The A2DP defines the protocol to implement distribution of high-quality audio content in mono or stereo on ACL channels.

Terms and Acronyms

Terms Details
SBC The Low Complexity Subband Coding (SBC) is an audio subband codec specified by the Bluetooth Special Interest Group (SIG) for the Advanced Audio Distribution Profile (A2DP). SBC is a digital audio encoder and decoder used to transfer data to Bluetooth audio output devices like headphones or loudspeakers. For more information, please refer to Wikipedia.
AAC Advanced Audio Coding (AAC) is an audio coding standard for lossy digital audio compression. For more information, please refer to Wikipedia.
SEID Stream End Point Identifier (SEID) is a SEP identifier.
SEP Stream End Point (SEP) is a concept to expose available Transport Services and AV capabilities of the Application in order to negotiate a stream.
SNK Sink. A device is the SNK when it acts as a sink of a digital audio stream delivered from the SRC on the same piconet.
SRC Source. A device is the SRC when it acts as a source of a digital audio stream that is delivered to the SNK of the piconet.
Piconet A piconet is a computer network which links a wireless user group of devices using Bluetooth technology protocols. For more information, please refer to Wikipedia.

How to use this module

Functions

bt_status_t bt_a2dp_connect (uint32_t *handle, const bt_bd_addr_t *address, bt_a2dp_role_t role)
 This function connects to the specified remote device. More...
 
bt_status_t bt_a2dp_connect_response (uint32_t handle, bool accept)
 This function responds to the specified remote device's incoming connection. More...
 
bt_status_t bt_a2dp_disconnect (uint32_t handle)
 This function disconnects from the specified remote device. More...
 
bt_status_t bt_a2dp_start_streaming_response (uint32_t handle, bool accept)
 This function responds to the incoming streaming from the specified remote device. More...
 
bt_status_t bt_a2dp_suspend_streaming_response (uint32_t handle, bool accept)
 This function responds to suspended streaming from the specified remote device. More...
 
bt_status_t bt_a2dp_reconfigure_response (uint32_t handle, bool accept)
 This function responds to the reconfiguration of the specified remote device. More...
 
bt_status_t bt_a2dp_get_init_params (bt_a2dp_init_params_t *param)
 This function is A2DP initialization API. More...
 
void bt_a2dp_hold_media_data_node (uint8_t *data_node)
 This function holds a media packet from A2DP, preventing from that the packet is released before consumed. More...
 
void bt_a2dp_release_media_data_node (uint8_t *data_node)
 This function releases a media packet after it is consumed. More...
 

Modules

 Define
 
 Struct
 

Function Documentation

bt_status_t bt_a2dp_connect ( uint32_t *  handle,
const bt_bd_addr_t address,
bt_a2dp_role_t  role 
)

This function connects to the specified remote device.

The BT_A2DP_CONNECT_CNF event will be sent to the upper layer with connection request result.

Parameters
[out]handleis the connection handle of the specified remote device. The handle can be used to abort the connection before BT_A2DP_CONNECT_CNF arrives.
[in]addressis the Bluetooth address of a remote device.
[in]roleis local device's A2DP role.
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_a2dp_connect_response ( uint32_t  handle,
bool  accept 
)

This function responds to the specified remote device's incoming connection.

The BT_A2DP_CONNECT_CNF event will be sent to the upper layer with connection request result.

Parameters
[in]handleis the A2DP handle for the specified remote device.
[in]acceptdefines whether accept or reject remote device's connection request.
Returns
BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed.
bt_status_t bt_a2dp_disconnect ( uint32_t  handle)

This function disconnects from the specified remote device.

The BT_A2DP_DISCONNECT_CNF event will be sent to the upper layer with disconnection request result.

Parameters
[in]handleis the A2DP handle for the specified 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_a2dp_get_init_params ( bt_a2dp_init_params_t param)

This function is A2DP initialization API.

Implementation is required.

Parameters
[out]paramis the initialization parameter. The value is provided once it is called by A2DP.
Returns
BT_STATUS_SUCCESS, A2DP is enabled successfully. BT_STATUS_FAIL, A2DP is enabled failed. BT_STATUS_OUT_OF_MEMORY, out of memory.
void bt_a2dp_hold_media_data_node ( uint8_t *  data_node)

This function holds a media packet from A2DP, preventing from that the packet is released before consumed.

Parameters
[in]data_nodeis media packet node which needs to be kept, preventing that it is released before it is consumed.
Returns
None.
bt_status_t bt_a2dp_reconfigure_response ( uint32_t  handle,
bool  accept 
)

This function responds to the reconfiguration of the specified remote device.

Parameters
[in]handleis the A2DP handle for the specified remote device.
[in]acceptdefines whether to accept or reject the reconfiguration request.
Returns
BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed. BT_STATUS_OUT_OF_MEMORY, out of memory.
void bt_a2dp_release_media_data_node ( uint8_t *  data_node)

This function releases a media packet after it is consumed.

Parameters
[in]data_nodeis media packet node which needs be released after it is consumed.
Returns
None.
bt_status_t bt_a2dp_start_streaming_response ( uint32_t  handle,
bool  accept 
)

This function responds to the incoming streaming from the specified remote device.

Parameters
[in]handleis the A2DP handle for the specified remote device.
[in]acceptdefines whether to accept or reject the streaming request.
Returns
BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed.
bt_status_t bt_a2dp_suspend_streaming_response ( uint32_t  handle,
bool  accept 
)

This function responds to suspended streaming from the specified remote device.

Parameters
[in]handleis the A2DP handle for the specified remote device.
[in]acceptdefines whether to accept or reject the suspension request.
Returns
BT_STATUS_SUCCESS, the operation completed successfully. BT_STATUS_FAIL, the operation has failed. BT_STATUS_OUT_OF_MEMORY, out of memory.