A2DP#

Functions#

int32_t
rsi_bt_a2dp_init(rsi_bt_a2dp_sbc_codec_cap_t *sbc_cap)

Initialize A2DP Profile with either user-defined audio codec params or default stack audio codec params. This is a blocking API.

int32_t
rsi_bt_a2dp_connect(uint8_t *remote_dev_addr)

Initiate the A2DP connection. This is a blocking API. A received event rsi_bt_on_a2dp_connect_t indicates that the a2dp connection response.

int32_t
rsi_bt_a2dp_disconnect(uint8_t *remote_dev_addr)

Use to disconnect A2DP. This is a blocking API. A received event rsi_bt_on_a2dp_disconnect_t indicates that the a2dp disconnection response.

int32_t
rsi_bt_a2dp_send_pcm_mp3_data(uint8_t *remote_dev_addr, uint8_t *pcm_mp3_data, uint16_t pcm_mp3_data_len, uint8_t audio_type)

Send the PCM data to the BT stack. This is a blocking API. if returns RSI_APP_ERR_HW_BUFFER_OVERFLOW err means that the firmware buffers are full and eventually host will receive a event rsi_bt_on_a2dp_data_req_t which requests more data from application.

int32_t
rsi_bt_a2dp_send_sbc_aac_data(uint8_t *remote_dev_addr, uint8_t *sbc_aac_data, uint16_t sbc_aac_data_len, uint8_t audio_type)

Send the SBC/AAC data to the BT stack. This is a blocking API. if returns RSI_APP_ERR_HW_BUFFER_OVERFLOW err means that the firmware buffers are full and eventually host will receive a event rsi_bt_on_a2dp_data_req_t which requests more data from application.

int32_t
rsi_bt_a2dp_start(uint8_t *remote_dev_addr)

Send the A2DP start to the BT stack to start the stream procedure. This is a blocking API. A received event rsi_bt_on_a2dp_start_t indicates that the a2dp start response.

int32_t
rsi_bt_a2dp_suspend(uint8_t *remote_dev_addr)

Send the A2DP suspend to the BT stack. This is a blocking API. A received event rsi_bt_on_a2dp_suspend_t indicates that the a2dp suspend response.

int32_t
rsi_bt_a2dp_close(uint8_t *remote_dev_addr)

Send the A2DP close to the BT stack for removing the a2dp stream. This is a blocking API. A received event rsi_bt_on_a2dp_close_t indicates that the a2dp close response.

int32_t
rsi_bt_a2dp_abort(uint8_t *remote_dev_addr)

Send the A2DP abort to the BT stack for aborting the exsting a2dp link. This is a blocking API. A received event rsi_bt_on_a2dp_abort_t indicates that the a2dp abort response.

int32_t
rsi_bt_a2dp_get_config(uint8_t *remote_dev_addr, rsi_bt_resp_a2dp_get_config_t *sbc_resp_cap)

To get remote device CODEC configuration. This is a blocking API. .

int32_t
rsi_bt_a2dp_set_config(uint8_t *remote_dev_addr, rsi_bt_a2dp_sbc_codec_cap_t *set_sbc_cap, int32_t *status)

Set A2DP CODEC configuration. Used for A2DP Reconfig purposes. This is a blocking API. A received event rsi_bt_on_a2dp_reconfig_t indicates that the a2dp reconfig response.

Function Documentation#

rsi_bt_a2dp_init#

int32_t rsi_bt_a2dp_init (rsi_bt_a2dp_sbc_codec_cap_t * sbc_cap)

Initialize A2DP Profile with either user-defined audio codec params or default stack audio codec params. This is a blocking API.

Parameters
[in]sbc_cap

- audio codec params structure, please refer rsi_bt_a2dp_sbc_codec_cap_s structure for more info.

Returns

  • 0 - Success Non-Zero Value - Failure

Note

  • Refer Error Codes section for common error codes Error Codes .

  • if NULL is passed, A2DP profile initialize with default audio codec params.


Definition at line 39 of file bluetooth/rsi_bt_a2dp_apis.c

rsi_bt_a2dp_connect#

int32_t rsi_bt_a2dp_connect (uint8_t * remote_dev_addr)

Initiate the A2DP connection. This is a blocking API. A received event rsi_bt_on_a2dp_connect_t indicates that the a2dp connection response.

Parameters
[in]remote_dev_addr

- remote device address

Returns

  • 0 - Success Non-Zero Value - Failure 0x4511 RSI_APP_ERR_A2DP_CONN_ALRDY_EXISTS

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 63 of file bluetooth/rsi_bt_a2dp_apis.c

rsi_bt_a2dp_disconnect#

int32_t rsi_bt_a2dp_disconnect (uint8_t * remote_dev_addr)

Use to disconnect A2DP. This is a blocking API. A received event rsi_bt_on_a2dp_disconnect_t indicates that the a2dp disconnection response.

Parameters
[in]remote_dev_addr

- remote device address

Returns

  • 0 - Success Non-Zero Value - Failure

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 85 of file bluetooth/rsi_bt_a2dp_apis.c

rsi_bt_a2dp_send_pcm_mp3_data#

int32_t rsi_bt_a2dp_send_pcm_mp3_data (uint8_t * remote_dev_addr, uint8_t * pcm_mp3_data, uint16_t pcm_mp3_data_len, uint8_t audio_type)

Send the PCM data to the BT stack. This is a blocking API. if returns RSI_APP_ERR_HW_BUFFER_OVERFLOW err means that the firmware buffers are full and eventually host will receive a event rsi_bt_on_a2dp_data_req_t which requests more data from application.

Parameters
[in]remote_dev_addr

- remote device address

[in]pcm_mp3_data

- PCM data buffer.

[in]pcm_mp3_data_len

- PCM data length.

[in]audio_type

- audio type. 0 - Reserved 1 - PCM Audio 2 - SBC Audio 3 - MP3 Audio

Returns

  • 0 - Success Non-Zero Value - Failure 0x4512 RSI_APP_ERR_A2DP_NOT_STREAMING 0x4049 RSI_APP_ERR_A2DP_INVALID_SOCKET 0x4057 RSI_APP_ERR_HW_BUFFER_OVERFLOW

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 125 of file bluetooth/rsi_bt_a2dp_apis.c

rsi_bt_a2dp_send_sbc_aac_data#

int32_t rsi_bt_a2dp_send_sbc_aac_data (uint8_t * remote_dev_addr, uint8_t * sbc_aac_data, uint16_t sbc_aac_data_len, uint8_t audio_type)

Send the SBC/AAC data to the BT stack. This is a blocking API. if returns RSI_APP_ERR_HW_BUFFER_OVERFLOW err means that the firmware buffers are full and eventually host will receive a event rsi_bt_on_a2dp_data_req_t which requests more data from application.

Parameters
[in]remote_dev_addr

- remote device address

[in]sbc_aac_data

- SBC/AAC data buffer.

[in]sbc_aac_data_len

- SBC/AAC data length.

[in]audio_type

- audio type. 0 - Reserved 1 - PCM Audio 2 - SBC Audio 3 - MP3 Audio

Returns

  • 0 - Success Non-Zero Value - Failure 0x4512 RSI_APP_ERR_A2DP_NOT_STREAMING 0x4049 RSI_APP_ERR_A2DP_INVALID_SOCKET 0x4057 RSI_APP_ERR_HW_BUFFER_OVERFLOW 0x405D RSI_APP_ERR_HW_BUFFER_OVERFLOW_TIMEOUT

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 198 of file bluetooth/rsi_bt_a2dp_apis.c

rsi_bt_a2dp_start#

int32_t rsi_bt_a2dp_start (uint8_t * remote_dev_addr)

Send the A2DP start to the BT stack to start the stream procedure. This is a blocking API. A received event rsi_bt_on_a2dp_start_t indicates that the a2dp start response.

Parameters
[in]remote_dev_addr

- remote device address.

Returns

  • 0 - Success Non-Zero Value - Failure

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 230 of file bluetooth/rsi_bt_a2dp_apis.c

rsi_bt_a2dp_suspend#

int32_t rsi_bt_a2dp_suspend (uint8_t * remote_dev_addr)

Send the A2DP suspend to the BT stack. This is a blocking API. A received event rsi_bt_on_a2dp_suspend_t indicates that the a2dp suspend response.

Parameters
[in]remote_dev_addr

- remote device address.

Returns

  • 0 - Success Non-Zero Value - Failure

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 255 of file bluetooth/rsi_bt_a2dp_apis.c

rsi_bt_a2dp_close#

int32_t rsi_bt_a2dp_close (uint8_t * remote_dev_addr)

Send the A2DP close to the BT stack for removing the a2dp stream. This is a blocking API. A received event rsi_bt_on_a2dp_close_t indicates that the a2dp close response.

Parameters
[in]remote_dev_addr

- remote device address.

Returns

  • 0 - Success Non-Zero Value - Failure

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 280 of file bluetooth/rsi_bt_a2dp_apis.c

rsi_bt_a2dp_abort#

int32_t rsi_bt_a2dp_abort (uint8_t * remote_dev_addr)

Send the A2DP abort to the BT stack for aborting the exsting a2dp link. This is a blocking API. A received event rsi_bt_on_a2dp_abort_t indicates that the a2dp abort response.

Parameters
[in]remote_dev_addr

- remote device address

Returns

  • 0 - Success Non-Zero Value - Failure

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 305 of file bluetooth/rsi_bt_a2dp_apis.c

rsi_bt_a2dp_get_config#

int32_t rsi_bt_a2dp_get_config (uint8_t * remote_dev_addr, rsi_bt_resp_a2dp_get_config_t * sbc_resp_cap)

To get remote device CODEC configuration. This is a blocking API. .

Parameters
[in]remote_dev_addr

- remote device address

[out]sbc_resp_cap

- get audio codec params response from stack, please refer rsi_bt_resp_a2dp_get_config_s structure for more info.

Returns

  • 0 - Success Non-Zero Value - Failure

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 330 of file bluetooth/rsi_bt_a2dp_apis.c

rsi_bt_a2dp_set_config#

int32_t rsi_bt_a2dp_set_config (uint8_t * remote_dev_addr, rsi_bt_a2dp_sbc_codec_cap_t * set_sbc_cap, int32_t * status)

Set A2DP CODEC configuration. Used for A2DP Reconfig purposes. This is a blocking API. A received event rsi_bt_on_a2dp_reconfig_t indicates that the a2dp reconfig response.

Parameters
[in]remote_dev_addr

- remote device address

[in]set_sbc_cap

- new SBC codec params used for reconfig, please refer rsi_bt_a2dp_sbc_codec_cap_s structure for more info.

[in]status

- This is the response status.

Returns

  • 0 - Success Non-Zero Value - Failure 0x4513 RSI_APP_ERR_A2DP_SBC_SAME_CODEC_PARAMS 0x4514 RSI_APP_ERR_A2DP_RECONFIG_CMD_TIMEOUT

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 361 of file bluetooth/rsi_bt_a2dp_apis.c