Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
wiced_bt_avdt.h File Reference

Bluetooth Audio Video Distribution Transport Protocol (AVDTP) Application Programming Interface. More...

Data Structures

struct  wiced_bt_avdt_sender_info_t
 
struct  wiced_bt_avdt_report_blk_t
 
union  wiced_bt_avdt_report_data_t
 
struct  wiced_bt_avdt_reg_t
 AVDT subsytem configuration. More...
 
struct  wiced_bt_avdt_sep_info_t
 Stream endpoint information. More...
 
struct  wiced_bt_avdt_cfg_t
 Stream endpoint configuration. More...
 
struct  wiced_bt_avdt_evt_hdr_t
 Header for AVDT event callback data. More...
 
struct  wiced_bt_avdt_config_t
 Data for AVDT_GETCAP_CFM_EVT, AVDT_RECONFIG_IND_EVT, and AVDT_RECONFIG_CFM_EVT. More...
 
struct  wiced_bt_avdt_setconfig_t
 Data for AVDT_CONFIG_IND_EVT. More...
 
struct  wiced_bt_avdt_open_t
 This data structure is associated with the AVDT_OPEN_IND_EVT and AVDT_OPEN_CFM_EVT. More...
 
struct  wiced_bt_avdt_security_t
 Data for AVDT_SECURITY_IND_EVT and AVDT_SECURITY_CFM_EVT. More...
 
struct  wiced_bt_avdt_discover_t
 Data for AVDT_DISCOVER_CFM_EVT. More...
 
struct  wiced_bt_avdt_delay_rpt_t
 Data for AVDT_DELAY_REPORT_EVT. More...
 
union  wiced_bt_avdt_ctrl_t
 Data for AVDT event notifications. More...
 
struct  wiced_bt_avdt_cs_t
 This structure contains information required when a stream is created. More...
 

Macros

#define AVDT_VERSION_1_0   0x0100
 
#define AVDT_VERSION_1_2   0x0102
 
#define AVDT_VERSION_1_3   0x0103
 
#define AVDT_VERSION   AVDT_VERSION_1_3
 
#define AVDT_VERSION_DELAYREPORT   AVDT_VERSION_1_3 /* Delay Reporting */
 
#define AVDT_VERSION_CP   AVDT_VERSION_1_2 /* Content Protection */
 
#define AVDT_CODEC_TYPE_INDEX   2
 
#define AVDT_AL_HDR_SIZE   3
 
#define AVDT_MEDIA_HDR_SIZE   12
 
#define AVDT_MEDIA_CP_HDR_SIZE   1
 
#define AVDT_MAX_MEDIA_SIZE   (0xFFFF - AVDT_MEDIA_HDR_SIZE)
 
#define AVDT_MULTI_AV_HANDLE   0xFF
 
#define AVDT_MEDIA_OFFSET   23
 
#define AVDT_MARKER_SET   0x80
 
#define AVDT_INT   0 /* initiator */
 
#define AVDT_ACP   1 /* acceptor */
 
#define AVDT_RTCP_SDES_CNAME   1 /* SDES item CNAME */
 
#define AVDT_MAX_CNAME_SIZE   28
 
#define AVDT_MAX_EVT   (AVDT_DELAY_REPORT_CFM_EVT)
 
#define AVDT_PSM   0x0019
 
AVDT result codes.

API function return value result codes.

#define AVDT_SUCCESS   0
 Function successful.
 
#define AVDT_BAD_PARAMS   1
 Invalid parameters.
 
#define AVDT_NO_RESOURCES   2
 Not enough resources.
 
#define AVDT_BAD_HANDLE   3
 Bad handle.
 
#define AVDT_BUSY   4
 A procedure is already in progress.
 
#define AVDT_WRITE_FAIL   5
 Write failed.
 
AVDT SEP types.

Stream endpoint type.

#define AVDT_TSEP_SRC   0
 Source.
 
#define AVDT_TSEP_SNK   1
 Sink.
 
Media types

Media types

#define AVDT_MEDIA_AUDIO   0 /* Audio SEP */
 
#define AVDT_MEDIA_VIDEO   1 /* Video SEP */
 
#define AVDT_MEDIA_MULTI   2 /* Multimedia SEP */
 
Protocol service capabilities

Protocol service capabilities

#define AVDT_PSC_TRANS   (1<<1)
 Media transport.
 
#define AVDT_PSC_REPORT   (1<<2)
 Reporting.
 
#define AVDT_PSC_RECOV   (1<<3)
 Recovery.
 
#define AVDT_PSC_CP   (1<<4)
 Content protection.
 
#define AVDT_PSC_HDRCMP   (1<<5)
 Header compression.
 
#define AVDT_PSC_MUX   (1<<6)
 Multiplexing.
 
#define AVDT_PSC_CODEC   (1<<7)
 Codec.
 
#define AVDT_PSC_DELAY_RPT   (1<<8)
 Delay Report.
 
Recovery type

Recovery type

#define AVDT_RECOV_RFC2733   1
 RFC2733 recovery.
 
Header compression capabilities mask

Header compression capabilities mask

#define AVDT_HDRCMP_MEDIA   (1<<5)
 Available for media packets.
 
#define AVDT_HDRCMP_RECOV   (1<<6)
 Available for recovery packets.
 
#define AVDT_HDRCMP_BACKCH   (1<<7)
 Back channel supported.
 
Multiplexing capabilities mask

Multiplexing capabilities mask

#define AVDT_MUX_FRAG   (1<<7)
 Allow Adaptation Layer Fragmentation.
 
AVDT application service category

Application service category. This indicates the application service category.

#define AVDT_ASC_PROTECT   4
 Content protection.
 
#define AVDT_ASC_CODEC   7
 Codec.
 
AVDT content protection type

AVDT content protection type

#define AVDT_CP_TYPE_NONE   0
 Content protection not in use.
 
#define AVDT_CP_TYPE_DTCP   0x0001
 Content protection DTCP.
 
#define AVDT_CP_TYPE_SCMST   0x0002
 Content protection SCMS-T.
 
AVDT Error codes

The following are error codes defined in the AVDTP and GAVDP specifications. These error codes communicate protocol errors between AVDTP and the application. More detailed descriptions of the error codes and their appropriate use can be found in the AVDTP and GAVDP specifications. These error codes are unrelated to the result values returned by the AVDTP API functions.

#define AVDT_ERR_HEADER   0x01
 Bad packet header format.
 
#define AVDT_ERR_LENGTH   0x11
 Bad packet length.
 
#define AVDT_ERR_SEID   0x12
 Invalid SEID.
 
#define AVDT_ERR_IN_USE   0x13
 The SEP is in use.
 
#define AVDT_ERR_NOT_IN_USE   0x14
 The SEP is not in use.
 
#define AVDT_ERR_CATEGORY   0x17
 Bad service category.
 
#define AVDT_ERR_PAYLOAD   0x18
 Bad payload format.
 
#define AVDT_ERR_NSC   0x19
 Requested command not supported.
 
#define AVDT_ERR_INVALID_CAP   0x1A
 Reconfigure attempted invalid capabilities.
 
#define AVDT_ERR_RECOV_TYPE   0x22
 Requested recovery type not defined.
 
#define AVDT_ERR_MEDIA_TRANS   0x23
 Media transport capability not correct.
 
#define AVDT_ERR_RECOV_FMT   0x25
 Recovery service capability not correct.
 
#define AVDT_ERR_ROHC_FMT   0x26
 Header compression service capability not correct.
 
#define AVDT_ERR_CP_FMT   0x27
 Content protection service capability not correct.
 
#define AVDT_ERR_MUX_FMT   0x28
 Multiplexing service capability not correct.
 
#define AVDT_ERR_UNSUP_CFG   0x29
 Configuration not supported.
 
#define AVDT_ERR_BAD_STATE   0x31
 Message cannot be processed in this state.
 
#define AVDT_ERR_REPORT_FMT   0x65
 Report service capability not correct.
 
#define AVDT_ERR_SERVICE   0x80
 Invalid service category.
 
#define AVDT_ERR_RESOURCE   0x81
 Insufficient resources.
 
#define AVDT_ERR_INVALID_MCT   0xC1
 Invalid Media Codec Type.
 
#define AVDT_ERR_UNSUP_MCT   0xC2
 Unsupported Media Codec Type.
 
#define AVDT_ERR_INVALID_LEVEL   0xC3
 Invalid Level.
 
#define AVDT_ERR_UNSUP_LEVEL   0xC4
 Unsupported Level.
 
#define AVDT_ERR_INVALID_CP   0xE0
 Invalid Content Protection Type.
 
#define AVDT_ERR_INVALID_FORMAT   0xE1
 Invalid Content Protection format.
 
#define AVDT_ERR_CONNECT   0x07
 Connection failed. More...
 
#define AVDT_ERR_TIMEOUT   0x08
 Response timeout. More...
 
AVDT Events

#define AVDT_DISCOVER_CFM_EVT   0
 Discover confirm.
 
#define AVDT_GETCAP_CFM_EVT   1
 Get capabilities confirm.
 
#define AVDT_OPEN_CFM_EVT   2
 Open confirm.
 
#define AVDT_OPEN_IND_EVT   3
 Open indication.
 
#define AVDT_CONFIG_IND_EVT   4
 Configuration indication.
 
#define AVDT_START_CFM_EVT   5
 Start confirm.
 
#define AVDT_START_IND_EVT   6
 Start indication.
 
#define AVDT_SUSPEND_CFM_EVT   7
 Suspend confirm.
 
#define AVDT_SUSPEND_IND_EVT   8
 Suspend indication.
 
#define AVDT_CLOSE_CFM_EVT   9
 Close confirm.
 
#define AVDT_CLOSE_IND_EVT   10
 Close indication.
 
#define AVDT_RECONFIG_CFM_EVT   11
 Reconfiguration confirm.
 
#define AVDT_RECONFIG_IND_EVT   12
 Reconfiguration indication.
 
#define AVDT_SECURITY_CFM_EVT   13
 Security confirm.
 
#define AVDT_SECURITY_IND_EVT   14
 Security indication.
 
#define AVDT_WRITE_CFM_EVT   15
 Write confirm.
 
#define AVDT_CONNECT_IND_EVT   16
 Signaling channel connected.
 
#define AVDT_DISCONNECT_IND_EVT   17
 Signaling channel disconnected.
 
#define AVDT_REPORT_CONN_EVT   18
 Reporting channel connected.
 
#define AVDT_REPORT_DISCONN_EVT   19
 Reporting channel disconnected.
 
#define AVDT_DELAY_REPORT_EVT   20
 Delay report received.
 
#define AVDT_DELAY_REPORT_CFM_EVT   21
 Delay report response received.
 
#define AVDT_DISCOVER_EVT   22 /* Discover command received */
 
#define AVDT_GETCAP_EVT   23 /* Get capabilities command received */
 
#define AVDT_GETCAP_ALL_EVT   24 /* Get all capabilities command received */
 
Non-supported commands

Non-supported protocol command messages (used in wiced_bt_avdt_cs_t)

#define AVDT_NSC_SUSPEND   0x01 /* Suspend command not supported */
 
#define AVDT_NSC_RECONFIG   0x02 /* Reconfigure command not supported */
 
#define AVDT_NSC_SECURITY   0x04 /* Security command not supported */
 

Typedefs

typedef void( wiced_bt_avdt_ctrl_cback_t )(uint8_t handle, wiced_bt_device_address_t bd_addr, uint8_t event, wiced_bt_avdt_ctrl_t *p_data)
 Function wiced_bt_avdt_ctrl_cback_t. More...
 
typedef void( wiced_bt_avdt_data_cback_t )(uint8_t handle, BT_HDR *p_pkt, uint32_t time_stamp, uint8_t m_pt)
 Function wiced_bt_avdt_data_cback_t. More...
 
typedef void( wiced_bt_avdt_media_cback_t )(uint8_t handle, uint8_t *p_payload, uint32_t payload_len, uint32_t time_stamp, uint16_t seq_num, uint8_t m_pt, uint8_t marker)
 Function wiced_bt_avdt_media_cback_t. More...
 
typedef void( wiced_bt_avdt_report_cback_t )(uint8_t handle, AVDT_REPORT_TYPE type, wiced_bt_avdt_report_data_t *p_data)
 Function wiced_bt_avdt_report_cback_t. More...
 
typedef uint16_t( wiced_bt_avdt_getcap_req_t )(wiced_bt_device_address_t bd_addr, uint8_t seid, wiced_bt_avdt_cfg_t *p_cfg, wiced_bt_avdt_ctrl_cback_t *p_cback)
 

Functions

uint16_t wiced_bt_avdt_register (wiced_bt_avdt_reg_t *p_reg, wiced_bt_avdt_ctrl_cback_t *p_cback)
 Function wiced_bt_avdt_register. More...
 
void wiced_bt_avdt_deregister (void)
 Function wiced_bt_avdt_deregister. More...
 
uint16_t wiced_bt_avdt_create_stream (uint8_t *p_handle, wiced_bt_avdt_cs_t *p_cs)
 Function wiced_bt_avdt_create_stream. More...
 
uint16_t wiced_bt_avdt_remove_stream (uint8_t handle)
 Function wiced_bt_avdt_remove_stream. More...
 
uint16_t wiced_bt_avdt_update_stream (uint8_t sep_type, wiced_bool_t available)
 Function wiced_bt_avdt_update_stream. More...
 
uint16_t wiced_bt_avdt_discover_req (wiced_bt_device_address_t bd_addr, wiced_bt_avdt_sep_info_t *p_sep_info, uint8_t max_seps, wiced_bt_avdt_ctrl_cback_t *p_cback)
 Function wiced_bt_avdt_discover_req. More...
 
uint16_t wiced_bt_avdt_get_cap_req (wiced_bt_device_address_t bd_addr, uint8_t seid, wiced_bt_avdt_cfg_t *p_cfg, wiced_bt_avdt_ctrl_cback_t *p_cback)
 Function wiced_bt_avdt_get_cap_req. More...
 
uint16_t wiced_bt_avdt_get_all_cap_req (wiced_bt_device_address_t bd_addr, uint8_t seid, wiced_bt_avdt_cfg_t *p_cfg, wiced_bt_avdt_ctrl_cback_t *p_cback)
 Function wiced_bt_avdt_get_all_cap_req. More...
 
uint16_t wiced_bt_avdt_delay_report (uint8_t handle, uint8_t seid, uint16_t delay)
 Function wiced_bt_avdt_delay_report. More...
 
uint16_t wiced_bt_avdt_open_req (uint8_t handle, wiced_bt_device_address_t bd_addr, uint8_t seid, wiced_bt_avdt_cfg_t *p_cfg)
 Function wiced_bt_avdt_open_req. More...
 
uint16_t wiced_bt_avdt_config_rsp (uint8_t handle, uint8_t label, uint8_t error_code, uint8_t category)
 Function wiced_bt_avdt_config_rsp. More...
 
uint16_t wiced_bt_avdt_security_set_scms (uint8_t handle, wiced_bool_t enable, uint8_t scms_hdr)
 Function wiced_bt_avdt_security_set_scms. More...
 
uint16_t wiced_bt_avdt_start_req (uint8_t *p_handles, uint8_t num_handles)
 Function wiced_bt_avdt_start_req. More...
 
uint16_t wiced_bt_avdt_start_resp (uint8_t handle, uint8_t label, uint8_t status)
 Function wiced_bt_avdt_start_resp. More...
 
uint16_t wiced_bt_avdt_suspend_req (uint8_t *p_handles, uint8_t num_handles)
 Function wiced_bt_avdt_suspend_req. More...
 
uint16_t wiced_bt_avdt_close_req (uint8_t handle)
 Function wiced_bt_avdt_close_req. More...
 
uint16_t wiced_bt_avdt_reconfig_req (uint8_t handle, wiced_bt_avdt_cfg_t *p_cfg)
 Function wiced_bt_avdt_reconfig_req. More...
 
uint16_t wiced_bt_avdt_reconfig_rsp (uint8_t handle, uint8_t label, uint8_t error_code, uint8_t category)
 Function wiced_bt_avdt_reconfig_rsp. More...
 
uint16_t wiced_bt_avdt_security_req (uint8_t handle, uint8_t *p_data, uint16_t len)
 Function wiced_bt_avdt_security_req. More...
 
uint16_t wiced_bt_avdt_security_rsp (uint8_t handle, uint8_t label, uint8_t error_code, uint8_t *p_data, uint16_t len)
 Function wiced_bt_avdt_security_rsp. More...
 
uint16_t wiced_bt_avdt_write_req (uint8_t handle, uint8_t *p_media_buf, uint16_t buf_len, uint32_t time_stamp, uint8_t m_pt, wiced_bt_avdt_data_opt_mask_t opt)
 Function wiced_bt_avdt_write_req. More...
 
uint16_t wiced_bt_avdt_connect_req (wiced_bt_device_address_t bd_addr, uint8_t sec_mask, wiced_bt_avdt_ctrl_cback_t *p_cback)
 Function wiced_bt_avdt_connect_req. More...
 
uint16_t wiced_bt_avdt_disconnect_req (wiced_bt_device_address_t bd_addr, wiced_bt_avdt_ctrl_cback_t *p_cback)
 Function wiced_bt_avdt_disconnect_req. More...
 
uint16_t wiced_bt_avdt_get_l2cap_channel (uint8_t handle)
 Function wiced_bt_avdt_get_l2cap_channel. More...
 
uint16_t wiced_bt_avdt_get_signal_channel (uint8_t handle, wiced_bt_device_address_t bd_addr)
 Function wiced_bt_avdt_get_signal_channel. More...
 
uint8_t wiced_bt_avdt_set_trace_level (uint8_t new_level)
 

AVDT report types.

for reporting packets

#define AVDT_RTCP_PT_SR   200
 the packet type - SR (Sender Report)
 
#define AVDT_RTCP_PT_RR   201
 the packet type - RR (Receiver Report)
 
#define AVDT_RTCP_PT_SDES   202
 the packet type - SDES (Source Description)
 
typedef uint8_t AVDT_REPORT_TYPE
 

AVDT data option mask

AVDT data option mask is used in the write request

#define AVDT_DATA_OPT_NONE   0x00
 No option still add RTP header.
 
#define AVDT_DATA_OPT_NO_RTP   (0x01 << 0)
 Skip adding RTP header.
 
typedef uint8_t wiced_bt_avdt_data_opt_mask_t
 

Detailed Description

Bluetooth Audio Video Distribution Transport Protocol (AVDTP) Application Programming Interface.

Macro Definition Documentation

#define AVDT_ERR_CONNECT   0x07

Connection failed.

#define AVDT_ERR_TIMEOUT   0x08

Response timeout.

Typedef Documentation

typedef void( wiced_bt_avdt_ctrl_cback_t)(uint8_t handle, wiced_bt_device_address_t bd_addr, uint8_t event, wiced_bt_avdt_ctrl_t *p_data)

Function wiced_bt_avdt_ctrl_cback_t.

AVDT control callback

Note
This function passes control events to the application. This function is required for all registered stream endpoints and for the AVDT_DiscoverReq() and AVDT_GetCapReq() functions.
Parameters
[in]handle: AVDT connection handle
[in]bd_addr: Peer address
[in]event: AVDT event (see AVDT events)
[in]p_data: AVDT event data
Returns
Nothing
typedef void( wiced_bt_avdt_data_cback_t)(uint8_t handle, BT_HDR *p_pkt, uint32_t time_stamp, uint8_t m_pt)

Function wiced_bt_avdt_data_cback_t.

AVDT data callback

Note
It is executed when AVDTP has a media packet ready for the application. This function is required for SNK endpoints and not applicable for SRC endpoints.
Parameters
[in]handle: AVDT connection handle
[in]p_pkt: Pointer to the data packet
[in]time_stamp: Data packet time stamp
[in]m_pt: Marker and payload type byte
Returns
Nothing
typedef void( wiced_bt_avdt_media_cback_t)(uint8_t handle, uint8_t *p_payload, uint32_t payload_len, uint32_t time_stamp, uint16_t seq_num, uint8_t m_pt, uint8_t marker)

Function wiced_bt_avdt_media_cback_t.

AVDT media callback

Note
This is the second version of the data callback function. This version uses application buffer assigned by wiced_bt_avdt_set_media_buf. Caller can assign different buffer during callback or can leave the current buffer for further using. This callback is called when AVDTP has a media packet ready for the application. This function is required for SNK endpoints and not applicable for SRC endpoints.
Parameters
[in]handle: AVDT connection handle
[in]p_payload: Pointer to the payload
[in]payload_len: Payload length
[in]time_stamp: Time stamp
[in]seq_num: Sequence number
[in]m_pt: Marker and payload type byte
[in]marker: Marker byte
Returns
Nothing
typedef void( wiced_bt_avdt_report_cback_t)(uint8_t handle, AVDT_REPORT_TYPE type, wiced_bt_avdt_report_data_t *p_data)

Function wiced_bt_avdt_report_cback_t.

AVDT report callback

Note
It is executed when AVDTP has a reporting packet ready for the application. This function is required for streams created with AVDT_PSC_REPORT.
Parameters
[in]handle: AVDT connection handle
[in]type: Report type (see AVDT report types)
[in]p_data: Pointer to the report data
Returns
Nothing