Infineon Logo AIROC BTSDK v4.2 - 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
 AVDT sender report. More...
 
struct  wiced_bt_avdt_report_blk_t
 AVDT receiver report. More...
 
union  wiced_bt_avdt_report_data_t
 AVDT report. More...
 
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...
 
struct  wiced_bt_avdt_write_cfm_t
 This data structure is associated with the AVDT_WRITE_CFM_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_DELAYREPORT   AVDT_VERSION_1_3
 AVDTP version when feature was added. More...
 
#define AVDT_VERSION_CP   AVDT_VERSION_1_2
 Content Protection.
 
#define AVDT_CODEC_TYPE_INDEX   2
 The index to access the codec type in codec_info[]. More...
 
#define AVDT_AL_HDR_SIZE   3
 The size in bytes of a Adaptation Layer header. More...
 
#define AVDT_MEDIA_HDR_SIZE   12
 The size in bytes of a media packet header. More...
 
#define AVDT_MEDIA_CP_HDR_SIZE   1
 The size, in byte, of the SCMS Header. More...
 
#define AVDT_MAX_MEDIA_SIZE   (0xFFFF - AVDT_MEDIA_HDR_SIZE)
 AVDTP 7.5.3 Adaptation Layer Fragmentation original length of the un-fragmented transport packet should be specified by two bytes length field of Adaptation Layer Header. More...
 
#define AVDT_MULTI_AV_HANDLE   0xFF
 The handle is used when reporting MULTI_AV specific events. More...
 
#define AVDT_MEDIA_OFFSET   23
 The number of bytes needed by the protocol stack for the protocol headers of a media packet. More...
 
#define AVDT_MARKER_SET   0x80
 The marker bit is used by the application to mark significant events such as frame boundaries in the data stream. More...
 
#define AVDT_INT   0
 AVDT initiator/acceptor role for adaption. More...
 
#define AVDT_ACP   1
 AVDT acceptor.
 
#define AVDT_RTCP_SDES_CNAME   1
 SDES item CNAME.
 
#define AVDT_MAX_CNAME_SIZE   28
 Max AVDT command name length.
 
#define AVDT_MAX_EVT   (AVDT_DELAY_REPORT_CFM_EVT)
 Maximum processed event id.
 
#define AVDT_PSM   0x0019
 PSM for AVDT. More...
 
#define AVDT_CODEC_SIZE   14
 Codec Size. More...
 
#define AVDT_PROTECT_SIZE   90
 Max content protection info size.
 
AVDT protocol versions.

Avdt protocol versions.

#define AVDT_VERSION_1_0   0x0100
 AVDT Version 1.0.
 
#define AVDT_VERSION_1_2   0x0102
 AVDT Version 1.2.
 
#define AVDT_VERSION_1_3   0x0103
 AVDT Version 1.3.
 
stack supported AVDT protocol versions.

Avdt protocol version supported by stack.

#define AVDT_VERSION   AVDT_VERSION_1_3
 Avdt protocol version supported by stack.
 
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.
 
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)
 AVDT control callback This function passes control events to the application. More...
 
typedef void( wiced_bt_avdt_data_cback_t )(uint8_t handle, uint16_t seq, uint32_t time_stamp, uint8_t m_pt, uint8_t *p_rx_media, uint16_t media_len)
 AVDT data callback It is executed when AVDTP has a media packet ready for the application. 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)
 AVDT get capability request It is executed to retrieve the AVDT stream capabilities of remote device. More...
 

Functions

uint16_t wiced_bt_avdt_register (wiced_bt_avdt_reg_t *p_reg, wiced_bt_avdt_ctrl_cback_t *p_cback)
 Initialize AVDTP subsystem and register callback for event notification. More...
 
void wiced_bt_avdt_deregister (void)
 Called to deregister use AVDTP protocol. More...
 
uint16_t wiced_bt_avdt_create_stream (uint8_t *p_handle, wiced_bt_avdt_cs_t *p_cs)
 Create a stream endpoint. More...
 
uint16_t wiced_bt_avdt_remove_stream (uint8_t handle)
 Remove a stream endpoint. More...
 
uint16_t wiced_bt_avdt_update_stream (uint8_t sep_type, wiced_bool_t available)
 Change all the sink SEPs to available or unavailable This function can only be called if there is no active stream connection to the stream type to be updated. 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)
 This function initiates a connection to the AVDTP service on the peer device, if not already present, and discovers the stream endpoints on the peer device. 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)
 This function initiates a connection to the AVDTP service on the peer device, if not already present, and gets the capabilities of a stream endpoint on the peer device. 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)
 This function initiates a connection to the AVDTP service on the peer device, if not already present, and gets the capabilities of a stream endpoint on the peer device. More...
 
uint16_t wiced_bt_avdt_delay_report (uint8_t handle, uint8_t seid, uint16_t delay)
 This functions sends a Delay Report to the peer device that is associated with a particular SEID. 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)
 This function initiates a connection to the AVDTP service on the peer device, if not already present, and connects to a stream endpoint on a peer device. More...
 
uint16_t wiced_bt_avdt_config_rsp (uint8_t handle, uint8_t label, uint8_t error_code, uint8_t category)
 Respond to a configure request from the peer device. More...
 
uint16_t wiced_bt_avdt_security_set_scms (uint8_t handle, wiced_bool_t enable, uint8_t scms_hdr)
 Set the SCMS Content Protection. More...
 
uint16_t wiced_bt_avdt_start_req (uint8_t *p_handles, uint8_t num_handles)
 Start one or more stream endpoints. More...
 
uint16_t wiced_bt_avdt_start_resp (uint8_t handle, uint8_t label, uint8_t status)
 Sends A2DP start response . More...
 
uint16_t wiced_bt_avdt_suspend_req (uint8_t *p_handles, uint8_t num_handles)
 Suspend one or more stream endpoints. More...
 
uint16_t wiced_bt_avdt_close_req (uint8_t handle)
 Description Close a stream endpoint. More...
 
uint16_t wiced_bt_avdt_reconfig_req (uint8_t handle, wiced_bt_avdt_cfg_t *p_cfg)
 Reconfigure a stream endpoint. More...
 
uint16_t wiced_bt_avdt_reconfig_rsp (uint8_t handle, uint8_t label, uint8_t error_code, uint8_t category)
 Respond to a reconfigure request from the peer device. More...
 
uint16_t wiced_bt_avdt_security_req (uint8_t handle, uint8_t *p_data, uint16_t len)
 Send a security request to the peer device. 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)
 Respond to a security request from the peer device. 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)
 Send a media packet to the peer device. 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)
 This function initiates an AVDTP signaling connection to the peer device. More...
 
uint16_t wiced_bt_avdt_disconnect_req (wiced_bt_device_address_t bd_addr, wiced_bt_avdt_ctrl_cback_t *p_cback)
 This function disconnect an AVDTP signaling connection to the peer device. More...
 
uint16_t wiced_bt_avdt_get_l2cap_channel (uint8_t handle)
 Get the L2CAP CID used by the handle. More...
 
uint16_t wiced_bt_avdt_get_signal_channel (uint8_t handle, wiced_bt_device_address_t bd_addr)
 Get the L2CAP CID used by the signal channel of the given handle. More...
 
uint16_t wiced_bt_avdt_set_media_buf (uint8_t handle, uint8_t *p_buf, uint32_t buf_len)
 Assigns buffer for media packets or forbids using of assigned buffer if argument p_buf is NULL. More...
 
uint16_t wiced_bt_avdt_send_report (uint8_t handle, AVDT_REPORT_TYPE type, wiced_bt_avdt_report_data_t *p_data)
 Sends report packet. More...
 

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 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
 AVDT data opt mask.
 

Detailed Description

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