Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Audio/Video Distribution Transport (AVDT)

This section describes the API's of Audio/Video Distribution Transport protocol. 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.
 

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 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.
 

AVDT report types.

for reporting packets

typedef uint8_t AVDT_REPORT_TYPE
 AVDT report type.
 
#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)
 

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.
 

AVDT data option mask

AVDT data option mask is used in the write request

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

Detailed Description

This section describes the API's of Audio/Video Distribution Transport protocol.

Macro Definition Documentation

#define AVDT_AL_HDR_SIZE   3

The size in bytes of a Adaptation Layer header.

Adaptation layer header size

#define AVDT_CODEC_SIZE   14

Codec Size.

AVDT codec size

#define AVDT_CODEC_TYPE_INDEX   2

The index to access the codec type in codec_info[].

Index in codec_info[]

#define AVDT_ERR_CONNECT   0x07

Connection failed.

#define AVDT_ERR_TIMEOUT   0x08

Response timeout.

#define AVDT_INT   0

AVDT initiator/acceptor role for adaption.

AVDT initiator

#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.

This constant is used to check or set the marker bit in the m_pt parameter of an wiced_bt_avdt_write_req() or AVDT_DATA_IND_EVT.AVDT Market bit

#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.

AVDT maximum size of media packet

#define AVDT_MEDIA_CP_HDR_SIZE   1

The size, in byte, of the SCMS Header.

Media Content protection header size

#define AVDT_MEDIA_HDR_SIZE   12

The size in bytes of a media packet header.

Media packet header size

#define AVDT_MEDIA_OFFSET   23

The number of bytes needed by the protocol stack for the protocol headers of a media packet.

This is the size of the media packet header, the L2CAP packet header and HCI header.Media packet header size including l2cap & HCI headers

#define AVDT_MULTI_AV_HANDLE   0xFF

The handle is used when reporting MULTI_AV specific events.

AVDT Handle for MULTI_AV events

#define AVDT_PSM   0x0019

PSM for AVDT.

AVDT PSM value

#define AVDT_VERSION_DELAYREPORT   AVDT_VERSION_1_3

AVDTP version when feature was added.

Delay Reporting

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)

AVDT control callback 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, 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.

This function is required for SNK endpoints and not applicable for SRC endpoints.

Parameters
[in]handle: AVDT connection handle
[in]seq: Seuence number
[in]time_stamp: Data packet time stamp
[in]m_pt: Marker and payload type byte
[in]p_rx_media: Pointer to the received media content
[in]media_len: Length of received media
Returns
Nothing
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.

Parameters
[in]bd_addr: bluetooth address of remote device
[in]seid: Stream end point id
[in]p_cfg: Stream Configuration
[in]p_cback: Callback function upon getCapabilityReq completion
Returns
Nothing

Function Documentation

uint16_t wiced_bt_avdt_close_req ( uint8_t  handle)

Description Close a stream endpoint.

This stops the transfer of media packets and closes the transport channel associated with this stream endpoint. When the stream is closed, an AVDT_CLOSE_CFM_EVT is sent to the application via the control callback function for this handle.

Parameters
[in]handle: AVDT connection handle
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
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.

This function must be called if the application receives an AVDT_CONFIG_IND_EVT through its control callback.

Parameters
[in]handle: AVDT connection handle
[in]label: Transaction label
[in]error_code: Error code (see AVDT error codes)
[in]category: Service category (see AVDT service categories)
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
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.

When the connection is completed, an AVDT_CONNECT_IND_EVT is sent to the application via its control callback function. If the connection attempt fails an AVDT_DISCONNECT_IND_EVT is sent. The security mask parameter overrides the outgoing security mask set in wiced_bt_avdt_register().

Parameters
[in]bd_addr: Peer bd_addr
[in]sec_mask: Security requirement
[in]p_cback: Callback for event notifications
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.

Note BD_Address must be in Big Endian format

uint16_t wiced_bt_avdt_create_stream ( uint8_t *  p_handle,
wiced_bt_avdt_cs_t p_cs 
)

Create a stream endpoint.

After a stream endpoint is created an application can initiate a connection between this endpoint and an endpoint on a peer device. In addition, a peer device can discover, get the capabilities, and connect to this endpoint.

Parameters
[out]p_handle: Connection handle (valid if AVRC_SUCCESS is returned)
[in]p_cs: Stream configuration
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
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.

This function is called by SNK device.

Parameters
[in]handle: AVDT connection handle
[in]seid: Stream end point ID
[in]delay: Amount of delay in ms
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
void wiced_bt_avdt_deregister ( void  )

Called to deregister use AVDTP protocol.

Before this function can be called, all streams must be removed with wiced_bt_avdt_remove_stream().

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.

When disconnected an AVDT_DISCONNECT_IND_EVT is sent to the application via its control callback function.

Parameters
[in]bd_addr: Peer bd_addr
[in]p_cback: Callback for event notifications
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.

Note BD_Address must be in Big Endian format

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.

(Please note that AVDTP discovery is unrelated to SDP discovery). This function can be called at any time regardless of whether there is an AVDTP connection to the peer device.

When discovery is complete, an AVDT_DISCOVER_CFM_EVT is sent to the application via its callback function. The application must not call wiced_bt_avdt_get_cap_req() or wiced_bt_avdt_discover_req() again to the same device until discovery is complete.

The memory addressed by sep_info is allocated by the application. This memory is written to by AVDTP as part of the discovery procedure. This memory must remain accessible until the application receives the AVDT_DISCOVER_CFM_EVT.

Parameters
[in]bd_addr: Peer bd_addr
[in]p_cback: Callback for discovery results
[in]max_seps: Maximun number of stream end point to discover
[out]p_sep_info: Pointer to the stream end point
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.

Note BD_Address must be in Big Endian format

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.

This function can be called at any time regardless of whether there is an AVDTP connection to the peer device.

When the procedure is complete, an AVDT_GETCAP_CFM_EVT is sent to the application via its callback function. The application must not call wiced_bt_avdt_get_cap_req() or wiced_bt_avdt_discover_req() again until the procedure is complete.

The memory pointed to by p_cfg is allocated by the application. This memory is written to by AVDTP as part of the get capabilities procedure. This memory must remain accessible until the application receives the AVDT_GETCAP_CFM_EVT.

Parameters
[in]bd_addr: Peer bd_addr
[in]seid: Stream end point ID (From wiced_bt_avdt_discover_req)
[in]p_cback: Callback for results
[out]p_cfg: Pointer to the stream end point configuration
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.

Note BD_Address must be in Big Endian format

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.

This function can be called at any time regardless of whether there is an AVDTP connection to the peer device.

When the procedure is complete, an AVDT_GETCAP_CFM_EVT is sent to the application via its callback function. The application must not call wiced_bt_avdt_get_cap_req() or wiced_bt_avdt_discover_req() again until the procedure is complete.

The memory pointed to by p_cfg is allocated by the application. This memory is written to by AVDTP as part of the get capabilities procedure. This memory must remain accessible until the application receives the AVDT_GETCAP_CFM_EVT.

Parameters
[in]bd_addr: Peer bd_addr
[in]seid: Stream end point ID (From wiced_bt_avdt_discover_req)
[in]p_cback: Callback for results
[out]p_cfg: Pointer to the stream end point configuration
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.

Note BD_Address must be in Big Endian format

uint16_t wiced_bt_avdt_get_l2cap_channel ( uint8_t  handle)

Get the L2CAP CID used by the handle.

Parameters
[in]handle: AVDT connection handle
Returns
CID if successful, otherwise 0.
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.

Parameters
[in]handle: AVDT connection handle
[in]bd_addr: Peer bd_addr
Returns
CID if successful, otherwise 0.

Note BD_Address must be in Big Endian format

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.

When the connection is completed, an AVDT_OPEN_CFM_EVT is sent to the application via the control callback function for this handle.

Parameters
[in]handle: AVDT connection handle
[in]bd_addr: Peer bd_addr
[in]seid: Stream end point ID
[in]p_cfg: Pointer to the stream end point configuration
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.

Note BD_Address must be in Big Endian format

uint16_t wiced_bt_avdt_reconfig_req ( uint8_t  handle,
wiced_bt_avdt_cfg_t p_cfg 
)

Reconfigure a stream endpoint.

This allows the application to change the codec or content protection capabilities of a stream endpoint after it has been opened. This function can only be called if the stream is opened but not started or if the stream has been suspended. When the procedure is completed, an AVDT_RECONFIG_CFM_EVT is sent to the application via the control callback function for this handle.

Parameters
[in]handle: AVDT connection handle
[in]p_cfg: Pointer to the stream end point configuration
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
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.

This function must be called if the application receives an AVDT_RECONFIG_IND_EVT through its control callback.

Parameters
[in]handle: AVDT connection handle
[in]label: Transaction label
[in]error_code: Error code (see AVDT error codes)
[in]category: Service category (see AVDT service categories)
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
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.

This function must be called prior to calling other AVDT APIs.

Parameters
[in]p_reg: AVDT registration parameters
[in]p_cback: Callback for AVDT event notification
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
uint16_t wiced_bt_avdt_remove_stream ( uint8_t  handle)

Remove a stream endpoint.

This function is called when the application is no longer using a stream endpoint. If this function is called when the endpoint is connected the connection is closed and then the stream endpoint is removed.

Parameters
[in]handle: Connection handle
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
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.

When the security procedure is completed, an AVDT_SECURITY_CFM_EVT is sent to the application via the control callback function for this handle. (Please note that AVDTP security procedures are unrelated to Bluetooth link level security.)

Parameters
[in]handle: AVDT connection handle
[in]p_data: Pointer to the content protection data
[in]len: Length of the data
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
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.

This function must be called if the application receives an AVDT_SECURITY_IND_EVT through its control callback. (Please note that AVDTP security procedures are unrelated to Bluetooth link level security.)

Parameters
[in]handle: AVDT connection handle
[in]label: Transaction label
[in]error_code: Error code (see AVDT error codes)
[in]p_data: Pointer to the content protection data
[in]len: Length of the data
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
uint16_t wiced_bt_avdt_security_set_scms ( uint8_t  handle,
wiced_bool_t  enable,
uint8_t  scms_hdr 
)

Set the SCMS Content Protection.

This function must be called when the peer device is connected.

Parameters
[in]handle: AVDT connection handle
[in]enable: If true enable content protection, flase disable
[in]scms_hdr: SCMS content protection header
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
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.

Parameters
[in]handle: AVDT connection handle
[in]type: Report type (see AVDT report types)
[in]p_data: Pointer to the report data
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
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.

This function can only be called if the stream is a SNK.

AVDTP uses this buffer to reassemble fragmented media packets. When AVDTP receives a complete media packet, it calls the p_media_cback assigned by wiced_bt_avdt_create_stream(). This function can be called during callback to assign a different buffer for next media packet or can leave the current buffer for next packet.

Parameters
[in]handle: AVDT connection handle
[in]p_buf: Pointer to the medie buffer
[in]buf_len: Size of the buffer
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
uint16_t wiced_bt_avdt_start_req ( uint8_t *  p_handles,
uint8_t  num_handles 
)

Start one or more stream endpoints.

This initiates the transfer of media packets for the streams. All stream endpoints must previously be opened. When the streams are started, an AVDT_START_CFM_EVT is sent to the application via the control callback function for each stream.

Parameters
[in]p_handles: Pointer to the AVDT connection handles, each byte is a connection handle
[in]num_handles: Number of connections to start
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
uint16_t wiced_bt_avdt_start_resp ( uint8_t  handle,
uint8_t  label,
uint8_t  status 
)

Sends A2DP start response .

This initiates the transfer of media packets for the streams. All stream endpoints must previously be opened.This function must be called if the application receives an AVDT_START_IND_EVT through its control callback.

Parameters
[in]handle: AVDT connection handle
[in]label: Transaction label
[in]status: Indicates if start request is accepted(AVDT_SUCCESS) or rejected(AVDT Error codes)
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
uint16_t wiced_bt_avdt_suspend_req ( uint8_t *  p_handles,
uint8_t  num_handles 
)

Suspend one or more stream endpoints.

This suspends the transfer of media packets for the streams. All stream endpoints must previously be open and started. When the streams are suspended, an AVDT_SUSPEND_CFM_EVT is sent to the application via the control callback function for each stream.

Parameters
[in]p_handles: Pointer to the AVDT connection handles, each byte is a connection handle
[in]num_handles: Number of connections to suspend
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
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.

Parameters
[in]sep_type: (see AVDT sep type)
[in]available: If true set all SEPs to available, false set all SEPs to unavailable
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
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.

The stream must be started before this function is called. Also, this function can only be called if the stream is a SRC.

When AVDTP has sent the media packet, an AVDT_WRITE_CFM_EVT is sent to the application via the control callback. The application can decide whether to wait for the AVDT_WRITE_CFM_EVT, before making the next wiced_bt_avdt_write_req() call. The application may make its first call to wiced_bt_avdt_write_req() after it receives an AVDT_START_CFM_EVT or AVDT_START_IND_EVT.

The opt parameter allows passing specific options like:

  • NO_RTP : do not add the RTP header to buffer
Parameters
[in]handle: AVDT connection handle
[in]p_media_buf: Pointer to the media buffer to write
[in]buf_len: Size of the buffer
[in]time_stamp: Time stamp
[in]m_pt: Marker and payload byte
[in]opt: Date option mask (see AVDT data options)
Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.