A2DP#
Functions#
Initialize A2DP Profile with either user-defined audio codec params or default stack audio codec params. This is a blocking API.
Initiate the A2DP connection. This is a blocking API. A received event rsi_bt_on_a2dp_connect_t indicates that the a2dp connection response.
Use to disconnect A2DP. This is a blocking API. A received event rsi_bt_on_a2dp_disconnect_t indicates that the a2dp disconnection response.
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.
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.
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.
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.
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.
To get remote device CODEC configuration. This is a blocking API. .
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.
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.
Variable Documentation#
pcm_mp3_data#
int32_t uint8_t* pcm_mp3_data
137
of file bluetooth/rsi_bt_a2dp_apis.c
pcm_mp3_data_len#
bt_req_a2dp_pcm_mp3_pkt_part2 pcm_mp3_data_len
138
of file bluetooth/rsi_bt_a2dp_apis.c
audio_type#
bt_req_a2dp_pcm_mp3_pkt_part2 audio_type
139
of file bluetooth/rsi_bt_a2dp_apis.c
bt_req_a2dp_pcm_mp3_pkt_part1#
rsi_bt_req_a2dp_pcm_mp3_data_t bt_req_a2dp_pcm_mp3_pkt_part1
152
of file bluetooth/rsi_bt_a2dp_apis.c
bt_req_a2dp_pcm_mp3_pkt_part2#
rsi_bt_req_a2dp_pcm_mp3_data_t bt_req_a2dp_pcm_mp3_pkt_part2
165
of file bluetooth/rsi_bt_a2dp_apis.c
RSI_SUCCESS#
return RSI_SUCCESS
181
of file bluetooth/rsi_bt_a2dp_apis.c
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.
[in] | sbc_cap | - audio codec params structure, please refer rsi_bt_a2dp_sbc_codec_cap_s structure for more info. |
rsi_wireless_init() API needs to be called before this API.
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.
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.
[in] | remote_dev_addr | - remote device address |
Call rsi_bt_a2dp_init() before calling this API.
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 .
64
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.
[in] | remote_dev_addr | - remote device address |
Call rsi_bt_a2dp_init() and rsi_bt_a2dp_connect() before calling this API.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for common error codes Error Codes .
88
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, uint16_t * bytes_consumed)
N/A | remote_dev_addr | |
N/A | pcm_mp3_data | |
N/A | pcm_mp3_data_len | |
N/A | audio_type | |
N/A | bytes_consumed |
130
of file bluetooth/rsi_bt_a2dp_apis.c
UNUSED_PARAMETER#
UNUSED_PARAMETER (audio_type )
N/A |
145
of file bluetooth/rsi_bt_a2dp_apis.c
USED_PARAMETER#
USED_PARAMETER (remote_dev_addr )
N/A |
146
of file bluetooth/rsi_bt_a2dp_apis.c
USED_PARAMETER#
USED_PARAMETER (pcm_mp3_data )
N/A |
147
of file bluetooth/rsi_bt_a2dp_apis.c
USED_PARAMETER#
USED_PARAMETER (pcm_mp3_data_len )
N/A |
148
of file bluetooth/rsi_bt_a2dp_apis.c
rsi_ascii_dev_address_to_6bytes_rev#
rsi_ascii_dev_address_to_6bytes_rev (bt_req_a2dp_pcm_mp3_pkt_part1. dev_addr, remote_dev_addr )
N/A | dev_addr | |
N/A |
154
of file bluetooth/rsi_bt_a2dp_apis.c
memcpy#
memcpy (bt_req_a2dp_pcm_mp3_pkt_part1. dev_addr, (int8_t *) remote_dev_addr, 6 )
N/A | dev_addr | |
N/A | remote_dev_addr | |
N/A |
156
of file bluetooth/rsi_bt_a2dp_apis.c
memcpy#
memcpy (bt_req_a2dp_pcm_mp3_pkt_part1. pcm_mp3_data, pcm_mp3_data , bt_req_a2dp_pcm_mp3_pkt_part1. pcm_mp3_data_len)
N/A | pcm_mp3_data | |
N/A | ||
N/A | pcm_mp3_data_len |
161
of file bluetooth/rsi_bt_a2dp_apis.c
rsi_bt_driver_send_cmd#
rsi_bt_driver_send_cmd (RSI_BT_REQ_A2DP_PCM_MP3_DATA_PREFILL_1 , & bt_req_a2dp_pcm_mp3_pkt_part1, NULL )
N/A | ||
N/A | bt_req_a2dp_pcm_mp3_pkt_part1 | |
N/A |
163
of file bluetooth/rsi_bt_a2dp_apis.c
rsi_ascii_dev_address_to_6bytes_rev#
rsi_ascii_dev_address_to_6bytes_rev (bt_req_a2dp_pcm_mp3_pkt_part2. dev_addr, remote_dev_addr )
N/A | dev_addr | |
N/A |
167
of file bluetooth/rsi_bt_a2dp_apis.c
memcpy#
memcpy (bt_req_a2dp_pcm_mp3_pkt_part2. dev_addr, (int8_t *) remote_dev_addr, 6 )
N/A | dev_addr | |
N/A | remote_dev_addr | |
N/A |
169
of file bluetooth/rsi_bt_a2dp_apis.c
memcpy#
memcpy (bt_req_a2dp_pcm_mp3_pkt_part2. pcm_mp3_data, (pcm_mp3_data+sizeof(bt_req_a2dp_pcm_mp3_pkt_part1.pcm_mp3_data)) , bt_req_a2dp_pcm_mp3_pkt_part2. pcm_mp3_data_len)
N/A | pcm_mp3_data | |
N/A | ||
N/A | pcm_mp3_data_len |
174
of file bluetooth/rsi_bt_a2dp_apis.c
SL_PRINTF#
SL_PRINTF (SL_RSI_BT_A2DP_SEND_PCM_MP3_DATA_TRIGGER , BLUETOOTH , LOG_INFO )
N/A | ||
N/A | ||
N/A |
178
of file bluetooth/rsi_bt_a2dp_apis.c
rsi_bt_driver_send_cmd#
return rsi_bt_driver_send_cmd (RSI_BT_REQ_A2DP_PCM_MP3_DATA , & bt_req_a2dp_pcm_mp3_pkt_part2, NULL )
N/A | ||
N/A | bt_req_a2dp_pcm_mp3_pkt_part2 | |
N/A |
179
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.
[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 |
Call rsi_bt_a2dp_init() and rsi_bt_a2dp_connect() before calling this API. Call this API only after A2DP start is completed.
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 .
212
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.
[in] | remote_dev_addr | - remote device address. |
Call rsi_bt_a2dp_init() and rsi_bt_a2dp_connect() before calling this API. Call this API only after A2DP Open is completed.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for common error codes Error Codes .
245
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.
[in] | remote_dev_addr | - remote device address. |
Call rsi_bt_a2dp_init() and rsi_bt_a2dp_connect() before calling this API. Call this API only after A2DP start is completed.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for common error codes Error Codes .
271
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.
[in] | remote_dev_addr | - remote device address. |
Call rsi_bt_a2dp_init() and rsi_bt_a2dp_connect() before calling this API. Call this API only after A2DP start is completed.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for common error codes Error Codes .
297
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.
[in] | remote_dev_addr | - remote device address |
Call rsi_bt_a2dp_init() and rsi_bt_a2dp_connect() before calling this API. Call this API only after A2DP start is completed.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for common error codes Error Codes .
323
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. .
[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. |
Call rsi_bt_a2dp_init() and rsi_bt_a2dp_connect() before calling this API.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for common error codes Error Codes .
349
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.
[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. |
Call rsi_bt_a2dp_init() and rsi_bt_a2dp_connect() before calling this API. Call this API only after A2DP Open is completed.
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 .
381
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.
[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 |
Call rsi_bt_a2dp_init() and rsi_bt_a2dp_connect() before calling this API. Call this API only after A2DP start is completed.
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 .
3589
of file include/rsi_bt_apis.h