187 #define BT_A2DP_CONNECT_IND (BT_MODULE_A2DP | 0x1200) 189 #define BT_A2DP_CONNECT_CNF (BT_MODULE_A2DP | 0x1201) 190 #define BT_A2DP_DISCONNECT_IND (BT_MODULE_A2DP | 0x1202) 191 #define BT_A2DP_DISCONNECT_CNF (BT_MODULE_A2DP | 0x1203) 192 #define BT_A2DP_START_STREAMING_IND (BT_MODULE_A2DP | 0x1204) 194 #define BT_A2DP_START_STREAMING_CNF (BT_MODULE_A2DP | 0x1205) 195 #define BT_A2DP_SUSPEND_STREAMING_IND (BT_MODULE_A2DP | 0x1206) 197 #define BT_A2DP_SUSPEND_STREAMING_CNF (BT_MODULE_A2DP | 0x1207) 198 #define BT_A2DP_RECONFIGURE_IND (BT_MODULE_A2DP | 0x1208) 200 #define BT_A2DP_RECONFIGURE_CNF (BT_MODULE_A2DP | 0x1209) 201 #define BT_A2DP_STREAMING_RECEIVED_IND (BT_MODULE_A2DP | 0x120A) 206 #define BT_STATUS_A2DP_TIMEOUT (BT_MODULE_A2DP|0xF0) 207 #define BT_STATUS_A2DP_BAD_STATE (BT_MODULE_A2DP|0xF1) 208 #define BT_STATUS_A2DP_NO_CONNECTION (BT_MODULE_A2DP|0xF2) 213 #define BT_A2DP_CODEC_SBC (0) 214 #define BT_A2DP_CODEC_AAC (2) 215 typedef uint8_t bt_a2dp_codec_type_t; 221 #define BT_A2DP_SOURCE (0) 222 #define BT_A2DP_SINK (1) 223 #define BT_A2DP_SOURCE_AND_SINK (2) 224 #define BT_A2DP_INVALID_ROLE (0xFF) 225 typedef uint8_t bt_a2dp_role_t; 231 #define BT_A2DP_IDLE (0) 232 #define BT_A2DP_OPENED (1) 233 #define BT_A2DP_STREAMING (2) 234 #define BT_A2DP_INVALID_STATE (0xFF) 235 typedef uint8_t bt_a2dp_state_t; 250 uint8_t channel_mode: 4;
252 uint8_t sample_freq: 4;
253 uint8_t alloc_method: 2;
255 uint8_t block_len: 4;
376 uint16_t total_length;
377 uint16_t media_offset;
384 uint32_t codec_number;
bt_status_t bt_a2dp_get_init_params(bt_a2dp_init_params_t *param)
This function is A2DP initialization API.
bt_status_t bt_a2dp_suspend_streaming(uint32_t handle)
This function suspends the current streaming with the specified remote device.
bt_status_t bt_a2dp_abort_streaming(uint32_t handle)
This function aborts the current connection channel with the specified remote device.
uint8_t bt_a2dp_role_t
The type of A2DP role.
Definition: bt_a2dp.h:229
This structure defines the data type of the parameter in the callback for BT_A2DP_SUSPEND_STREAMING_I...
Definition: bt_a2dp.h:346
bt_status_t bt_a2dp_reconfigure_response(uint32_t handle, bool accept)
This function responds to the reconfiguration of the specified remote device.
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.
bt_status_t bt_a2dp_reconfigure_stream(uint32_t handle, bt_a2dp_codec_capability_t *codec_cap)
This function reconfigures the already configured stream and the API needs to be called only in strea...
This structure defines the data type of the parameter in the callback for BT_A2DP_START_STREAMING_CNF...
Definition: bt_a2dp.h:337
This structure defines the data type of the parameter in the callback for BT_A2DP_SUSPEND_STREAMING_C...
Definition: bt_a2dp.h:353
This structure defines the data type of the parameter in the callback for BT_A2DP_STREAMING_RECEIVED_...
Definition: bt_a2dp.h:377
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.
uint8_t bt_a2dp_codec_type_t
The type of A2DP codec.
Definition: bt_a2dp.h:219
bt_status_t bt_a2dp_disconnect(uint32_t handle)
This function disconnects from the specified remote device.
This structure defines the data type of the parameter in the callback for BT_A2DP_CONNECT_IND event...
Definition: bt_a2dp.h:296
bt_status_t bt_a2dp_start_streaming(uint32_t handle)
This function starts streaming with the specified remote device.
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 cons...
This structure defines the initialization parameters.
Definition: bt_a2dp.h:387
This structure defines the data type of the parameter in the callback for BT_A2DP_DISCONNECT_IND even...
Definition: bt_a2dp.h:314
This structure defines the A2DP codec capability.
Definition: bt_a2dp.h:283
bt_status_t bt_a2dp_suspend_streaming_response(uint32_t handle, bool accept)
This function responds to suspended streaming from the specified remote device.
uint8_t bt_bd_addr_t[6]
Address type, defined in Bluetooth core specification version 4.2.
Definition: bt_type.h:180
int32_t bt_status_t
Define the status type, returned from the APIs, and defined as BT_STATUS_XXX.
Definition: bt_type.h:173
uint32_t bt_a2dp_get_mtu_size(uint32_t handle)
This function returns the maximum A2DP payload data value in bytes so that the app can send data less...
void bt_a2dp_release_media_data_node(uint8_t *data_node)
This function releases a media packet after it is consumed.
This structure defines the data type of the parameter in the callback for BT_A2DP_CONNECT_CNF event...
Definition: bt_a2dp.h:305
This structure defines the AAC codec details.
Definition: bt_a2dp.h:278
This structure defines the data type of the parameter in the callback for BT_A2DP_START_STREAMING_IND...
Definition: bt_a2dp.h:329
his structure defines the data type of the parameter in the callback for BT_A2DP_DISCONNECT_CNF event...
Definition: bt_a2dp.h:321
bt_status_t bt_a2dp_send_media_data(uint32_t handle, uint8_t *buffer, uint32_t payload_size, uint32_t timestamp)
This function sends media data to the remote device.
This structure defines the SBC codec details.
Definition: bt_a2dp.h:262
bt_status_t bt_a2dp_connect_response(uint32_t handle, bool accept)
This function responds to the specified remote device's incoming connection.