Audio/Video Distribution Transport (AVDT)¶
API Reference
-
group
wicedbt_avdt
This section describes the API’s of Audio/Video Distribution Transport protocol.
AVDT protocol versions.
Avdt protocol versions.
-
AVDT_VERSION_1_0
¶ AVDT Version 1.0.
-
AVDT_VERSION_1_2
¶ AVDT Version 1.2.
-
AVDT_VERSION_1_3
¶ AVDT Version 1.3.
stack supported AVDT protocol versions.
Avdt protocol version supported by stack.
-
AVDT_VERSION
¶ Avdt protocol version supported by stack.
AVDT result codes.
API function return value result codes.
-
AVDT_SUCCESS
¶ Function successful.
-
AVDT_BAD_PARAMS
¶ Invalid parameters.
-
AVDT_NO_RESOURCES
¶ Not enough resources.
-
AVDT_BAD_HANDLE
¶ Bad handle.
-
AVDT_BUSY
¶ A procedure is already in progress.
-
AVDT_WRITE_FAIL
¶ Write failed.
Media types
Media types
-
AVDT_MEDIA_AUDIO
¶ Audio SEP.
-
AVDT_MEDIA_VIDEO
¶ Video SEP.
-
AVDT_MEDIA_MULTI
¶ Multimedia SEP.
AVDT report types.
for reporting packets
-
typedef uint8_t
AVDT_REPORT_TYPE
¶ AVDT report type.
-
AVDT_RTCP_PT_SR
¶ the packet type - SR (Sender Report)
-
AVDT_RTCP_PT_RR
¶ the packet type - RR (Receiver Report)
-
AVDT_RTCP_PT_SDES
¶ the packet type - SDES (Source Description)
Protocol service capabilities
Protocol service capabilities
-
AVDT_PSC_TRANS
¶ Media transport.
-
AVDT_PSC_REPORT
¶ Reporting.
-
AVDT_PSC_RECOV
¶ Recovery.
-
AVDT_PSC_CP
¶ Content protection.
-
AVDT_PSC_HDRCMP
¶ Header compression.
-
AVDT_PSC_MUX
¶ Multiplexing.
-
AVDT_PSC_CODEC
¶ Codec.
-
AVDT_PSC_DELAY_RPT
¶ Delay Report.
Header compression capabilities mask
Header compression capabilities mask
-
AVDT_HDRCMP_MEDIA
¶ Available for media packets.
-
AVDT_HDRCMP_RECOV
¶ Available for recovery packets.
-
AVDT_HDRCMP_BACKCH
¶ Back channel supported.
Multiplexing capabilities mask
Multiplexing capabilities mask
-
AVDT_MUX_FRAG
¶ Allow Adaptation Layer Fragmentation.
AVDT application service category
Application service category. This indicates the application service category.
-
AVDT_ASC_PROTECT
¶ Content protection.
-
AVDT_ASC_CODEC
¶ Codec.
AVDT content protection type
AVDT content protection type
-
AVDT_CP_TYPE_NONE
¶ Content protection not in use.
-
AVDT_CP_TYPE_DTCP
¶ Content protection DTCP.
-
AVDT_CP_TYPE_SCMST
¶ 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.
-
AVDT_ERR_HEADER
¶ Bad packet header format.
-
AVDT_ERR_LENGTH
¶ Bad packet length.
-
AVDT_ERR_SEID
¶ Invalid SEID.
-
AVDT_ERR_IN_USE
¶ The SEP is in use.
-
AVDT_ERR_NOT_IN_USE
¶ The SEP is not in use.
-
AVDT_ERR_CATEGORY
¶ Bad service category.
-
AVDT_ERR_PAYLOAD
¶ Bad payload format.
-
AVDT_ERR_NSC
¶ Requested command not supported.
-
AVDT_ERR_INVALID_CAP
¶ Reconfigure attempted invalid capabilities.
-
AVDT_ERR_RECOV_TYPE
¶ Requested recovery type not defined.
-
AVDT_ERR_MEDIA_TRANS
¶ Media transport capability not correct.
-
AVDT_ERR_RECOV_FMT
¶ Recovery service capability not correct.
-
AVDT_ERR_ROHC_FMT
¶ Header compression service capability not correct.
-
AVDT_ERR_CP_FMT
¶ Content protection service capability not correct.
-
AVDT_ERR_MUX_FMT
¶ Multiplexing service capability not correct.
-
AVDT_ERR_UNSUP_CFG
¶ Configuration not supported.
-
AVDT_ERR_BAD_STATE
¶ Message cannot be processed in this state.
-
AVDT_ERR_REPORT_FMT
¶ Report service capability not correct.
-
AVDT_ERR_SERVICE
¶ Invalid service category.
-
AVDT_ERR_RESOURCE
¶ Insufficient resources.
-
AVDT_ERR_INVALID_MCT
¶ Invalid Media Codec Type.
-
AVDT_ERR_UNSUP_MCT
¶ Unsupported Media Codec Type.
-
AVDT_ERR_INVALID_LEVEL
¶ Invalid Level.
-
AVDT_ERR_UNSUP_LEVEL
¶ Unsupported Level.
-
AVDT_ERR_INVALID_CP
¶ Invalid Content Protection Type.
-
AVDT_ERR_INVALID_FORMAT
¶ Invalid Content Protection format.
-
AVDT_ERR_CONNECT
¶ Connection failed.
-
AVDT_ERR_TIMEOUT
¶ Response timeout.
AVDT Events
-
AVDT_DISCOVER_CFM_EVT
¶ Discover confirm.
-
AVDT_GETCAP_CFM_EVT
¶ Get capabilities confirm.
-
AVDT_OPEN_CFM_EVT
¶ Open confirm.
-
AVDT_OPEN_IND_EVT
¶ Open indication.
-
AVDT_CONFIG_IND_EVT
¶ Configuration indication.
-
AVDT_START_CFM_EVT
¶ Start confirm.
-
AVDT_START_IND_EVT
¶ Start indication.
-
AVDT_SUSPEND_CFM_EVT
¶ Suspend confirm.
-
AVDT_SUSPEND_IND_EVT
¶ Suspend indication.
-
AVDT_CLOSE_CFM_EVT
¶ Close confirm.
-
AVDT_CLOSE_IND_EVT
¶ Close indication.
-
AVDT_RECONFIG_CFM_EVT
¶ Reconfiguration confirm.
-
AVDT_RECONFIG_IND_EVT
¶ Reconfiguration indication.
-
AVDT_SECURITY_CFM_EVT
¶ Security confirm.
-
AVDT_SECURITY_IND_EVT
¶ Security indication.
-
AVDT_WRITE_CFM_EVT
¶ Write confirm.
-
AVDT_CONNECT_IND_EVT
¶ Signaling channel connected.
-
AVDT_DISCONNECT_IND_EVT
¶ Signaling channel disconnected.
-
AVDT_REPORT_CONN_EVT
¶ Reporting channel connected.
-
AVDT_REPORT_DISCONN_EVT
¶ Reporting channel disconnected.
-
AVDT_DELAY_REPORT_EVT
¶ Delay report received.
-
AVDT_DELAY_REPORT_CFM_EVT
¶ Delay report response received.
Non-supported commands
Non-supported protocol command messages (used in wiced_bt_avdt_cs_t)
-
AVDT_NSC_SUSPEND
¶ Suspend command not supported.
-
AVDT_NSC_RECONFIG
¶ Reconfigure command not supported.
-
AVDT_NSC_SECURITY
¶ 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.
-
AVDT_DATA_OPT_NONE
¶ No option still add RTP header.
-
AVDT_DATA_OPT_NO_RTP
¶ Skip adding RTP header.
Defines
-
AVDT_VERSION_DELAYREPORT
¶ AVDTP version when feature was added.
Delay Reporting
-
AVDT_VERSION_CP
¶ Content Protection.
-
AVDT_CODEC_TYPE_INDEX
¶ The index to access the codec type in codec_info[].
Index in codec_info[]
-
AVDT_AL_HDR_SIZE
¶ The size in bytes of a Adaptation Layer header.
Adaptation layer header size
-
AVDT_MEDIA_HDR_SIZE
¶ The size in bytes of a media packet header.
Media packet header size
-
AVDT_MEDIA_CP_HDR_SIZE
¶ The size, in byte, of the SCMS Header.
Media Content protection header size
-
AVDT_MAX_MEDIA_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
-
AVDT_MULTI_AV_HANDLE
¶ The handle is used when reporting MULTI_AV specific events.
AVDT Handle for MULTI_AV events
-
AVDT_MEDIA_OFFSET
¶ 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
-
AVDT_MARKER_SET
¶ 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
-
AVDT_INT
¶ AVDT initiator/acceptor role for adaption.
AVDT initiator
-
AVDT_ACP
¶ AVDT acceptor.
-
AVDT_RTCP_SDES_CNAME
¶ SDES item CNAME.
-
AVDT_MAX_CNAME_SIZE
¶ Max AVDT command name length.
-
AVDT_MAX_EVT
¶ Maximum processed event id.
-
AVDT_PSM
¶ PSM for AVDT.
AVDT PSM value
-
AVDT_CODEC_SIZE
¶ Codec Size.
AVDT codec size
-
AVDT_PROTECT_SIZE
¶ Max content protection info size.
Typedefs
-
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
handle – [in] : AVDT connection handle
bd_addr – [in] : Peer address
event – [in] : AVDT event (see AVDT events)
p_data – [in] : AVDT event data
- Returns
Nothing
-
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
handle – [in] : AVDT connection handle
seq – [in] : Seuence number
time_stamp – [in] : Data packet time stamp
m_pt – [in] : Marker and payload type byte
p_rx_media – [in] : Pointer to the received media content
media_len – [in] : Length of received media
- Returns
Nothing
-
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
bd_addr – [in] : bluetooth address of remote device
seid – [in] : Stream end point id
p_cfg – [in] : Stream Configuration
p_cback – [in] : Callback function upon getCapabilityReq completion
- Returns
Nothing
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.
This function must be called prior to calling other AVDT APIs.
- Parameters
p_reg – [in] : AVDT registration parameters
p_cback – [in] : Callback for AVDT event notification
- 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_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
p_handle – [out] : Connection handle (valid if AVRC_SUCCESS is returned)
p_cs – [in] : Stream configuration
- 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
handle – [in] : Connection handle
- 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
sep_type – [in] : (see AVDT sep type)
available – [in] : 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_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.
Note BD_Address must be in Big Endian format
- Parameters
bd_addr – [in] : Peer bd_addr
p_cback – [in] : Callback for discovery results
max_seps – [in] : Maximun number of stream end point to discover
p_sep_info – [out] : Pointer to the stream end point
- Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
-
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.
Note BD_Address must be in Big Endian format
- Parameters
bd_addr – [in] : Peer bd_addr
seid – [in] : Stream end point ID (From wiced_bt_avdt_discover_req)
p_cback – [in] : Callback for results
p_cfg – [out] : 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_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.
Note BD_Address must be in Big Endian format
- Parameters
bd_addr – [in] : Peer bd_addr
seid – [in] : Stream end point ID (From wiced_bt_avdt_discover_req)
p_cback – [in] : Callback for results
p_cfg – [out] : 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_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
handle – [in] : AVDT connection handle
seid – [in] : Stream end point ID
delay – [in] : Amount of delay in ms
- Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
-
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.
Note BD_Address must be in Big Endian format
- Parameters
handle – [in] : AVDT connection handle
bd_addr – [in] : Peer bd_addr
seid – [in] : Stream end point ID
p_cfg – [in] : 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_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
handle – [in] : AVDT connection handle
label – [in] : Transaction label
error_code – [in] : Error code (see AVDT error codes)
category – [in] : Service category (see AVDT service categories)
- 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
handle – [in] : AVDT connection handle
enable – [in] : If true enable content protection, flase disable
scms_hdr – [in] : SCMS content protection header
- 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
p_handles – [in] : Pointer to the AVDT connection handles, each byte is a connection handle
num_handles – [in] : 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
handle – [in] : AVDT connection handle
label – [in] : Transaction label
status – [in] : 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
p_handles – [in] : Pointer to the AVDT connection handles, each byte is a connection handle
num_handles – [in] : Number of connections to suspend
- Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
-
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
handle – [in] : AVDT connection handle
- Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
-
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
handle – [in] : AVDT connection handle
p_cfg – [in] : 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
handle – [in] : AVDT connection handle
label – [in] : Transaction label
error_code – [in] : Error code (see AVDT error codes)
category – [in] : Service category (see AVDT service categories)
- 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
handle – [in] : AVDT connection handle
p_data – [in] : Pointer to the content protection data
len – [in] : 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
handle – [in] : AVDT connection handle
label – [in] : Transaction label
error_code – [in] : Error code (see AVDT error codes)
p_data – [in] : Pointer to the content protection data
len – [in] : Length of the data
- 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
handle – [in] : AVDT connection handle
p_media_buf – [in] : Pointer to the media buffer to write
buf_len – [in] : Size of the buffer
time_stamp – [in] : Time stamp
m_pt – [in] : Marker and payload byte
opt – [in] : Date option mask (see AVDT data options)
- 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().
Note BD_Address must be in Big Endian format
- Parameters
bd_addr – [in] : Peer bd_addr
sec_mask – [in] : Security requirement
p_cback – [in] : Callback for event notifications
- Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
-
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.
Note BD_Address must be in Big Endian format
- Parameters
bd_addr – [in] : Peer bd_addr
p_cback – [in] : Callback for event notifications
- Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
-
uint16_t
wiced_bt_avdt_get_l2cap_channel
(uint8_t handle)¶ Get the L2CAP CID used by the handle.
- Parameters
handle – [in] : 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.
Note BD_Address must be in Big Endian format
- Parameters
handle – [in] : AVDT connection handle
bd_addr – [in] : Peer bd_addr
- Returns
CID if successful, otherwise 0.
-
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
handle – [in] : AVDT connection handle
p_buf – [in] : Pointer to the medie buffer
buf_len – [in] : Size of the buffer
- 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
handle – [in] : AVDT connection handle
type – [in] : Report type (see AVDT report types)
p_data – [in] : Pointer to the report data
- Returns
Result code (see AVDT result codes) AVDT_SUCCESS if successful, otherwise error.
-
struct
wiced_bt_avdt_sender_info_t
¶ - #include <>
AVDT sender report.
Public Members
-
uint32_t
ntp_sec
¶ NTP time: seconds relative to 0h UTC on 1 January 1900.
-
uint32_t
ntp_frac
¶ NTP time: the fractional part.
-
uint32_t
rtp_time
¶ timestamp in RTP header
-
uint32_t
pkt_count
¶ sender’s packet count: since starting transmission up until the time this SR packet was generated.
-
uint32_t
octet_count
¶ sender’s octet count: same comment
-
uint32_t
-
struct
wiced_bt_avdt_report_blk_t
¶ - #include <>
AVDT receiver report.
Public Members
-
uint8_t
frag_lost
¶ fraction lost since last RR
-
uint32_t
packet_lost
¶ cumulative number of packets lost since the beginning
-
uint32_t
seq_num_rcvd
¶ extended highest sequence number received
-
uint32_t
jitter
¶ interarrival jitter
-
uint32_t
lsr
¶ last SR timestamp
-
uint32_t
dlsr
¶ delay since last SR
-
uint8_t
-
union
wiced_bt_avdt_report_data_t
¶ - #include <>
AVDT report.
Public Members
-
wiced_bt_avdt_sender_info_t
sr
¶ sender information
-
wiced_bt_avdt_report_blk_t
rr
¶ report data
-
uint8_t
cname
[AVDT_MAX_CNAME_SIZE
+ 1]¶ command name
-
wiced_bt_avdt_sender_info_t
-
struct
wiced_bt_avdt_reg_t
¶ - #include <>
AVDT subsytem configuration.
Public Members
-
uint16_t
ctrl_mtu
¶ L2CAP MTU of the AVDTP signaling channel.
-
uint8_t
ret_tout
¶ AVDTP signaling retransmission timeout.
-
uint8_t
sig_tout
¶ AVDTP signaling message timeout.
-
uint8_t
idle_tout
¶ AVDTP idle signaling channel timeout.
-
uint8_t
sec_mask
¶ Security mask (not used on WICED platforms: security is configured using wiced_bt_cfg)
-
uint16_t
-
struct
wiced_bt_avdt_sep_info_t
¶ - #include <>
Stream endpoint information.
Public Members
-
wiced_bool_t
in_use
¶ TRUE if stream is currently in use.
-
uint8_t
seid
¶ Stream endpoint identifier.
-
uint8_t
media_type
¶ Media type (see Media types)
-
uint8_t
tsep
¶ SEP type (see Stream endpoint types)
-
uint16_t
psc_mask
¶ Protocol service capabilities mask.
-
wiced_bool_t
-
struct
wiced_bt_avdt_cfg_t
¶ - #include <>
Stream endpoint configuration.
Public Members
-
uint8_t
codec_info
[AVDT_CODEC_SIZE
]¶ Codec capabilities array (dependent on coded type; for SBC, use wiced_bt_a2d_bld_sbc_info or wiced_bt_a2d_pars_sbc_info to build/parse codec_info)
-
uint8_t
protect_info
[AVDT_PROTECT_SIZE
]¶ Content protection capabilities.
-
uint8_t
num_codec
¶ Number of media codec information elements.
-
uint8_t
num_protect
¶ Number of content protection information elements.
-
uint16_t
psc_mask
¶ Protocol service capabilities mask (see Protocol sevice capabilities)
-
uint8_t
recov_type
¶ Recovery type (see Recovery types)
-
uint8_t
recov_mrws
¶ Maximum recovery window size.
-
uint8_t
recov_mnmp
¶ Recovery maximum number of media packets.
-
uint8_t
hdrcmp_mask
¶ Header compression capabilities mask (see Header compression capabilities)
-
uint8_t
-
struct
wiced_bt_avdt_evt_hdr_t
¶ - #include <>
Header for AVDT event callback data.
Public Members
-
uint8_t
err_code
¶ Zero if operation succeeded; nonzero if operation failed.
-
uint8_t
err_param
¶ Error parameter included for some events.
-
uint8_t
label
¶ Transaction label.
-
uint8_t
seid
¶ For internal use only.
-
uint8_t
sig_id
¶ For internal use only.
-
uint8_t
ccb_idx
¶ For internal use only.
-
uint8_t
-
struct
wiced_bt_avdt_config_t
¶ - #include <>
Data for AVDT_GETCAP_CFM_EVT, AVDT_RECONFIG_IND_EVT, and AVDT_RECONFIG_CFM_EVT.
Public Members
-
wiced_bt_avdt_evt_hdr_t
hdr
¶ Event header.
-
wiced_bt_avdt_cfg_t *
p_cfg
¶ Pointer to configuration for this SEP.
-
wiced_bt_avdt_evt_hdr_t
-
struct
wiced_bt_avdt_setconfig_t
¶ - #include <>
Data for AVDT_CONFIG_IND_EVT.
Public Members
-
wiced_bt_avdt_evt_hdr_t
hdr
¶ Event header.
-
wiced_bt_avdt_cfg_t *
p_cfg
¶ Pointer to configuration for this SEP.
-
uint8_t
int_seid
¶ Stream endpoint ID of stream initiating the operation.
-
wiced_bt_avdt_evt_hdr_t
-
struct
wiced_bt_avdt_open_t
¶ - #include <>
This data structure is associated with the AVDT_OPEN_IND_EVT and AVDT_OPEN_CFM_EVT.
Public Members
-
wiced_bt_avdt_evt_hdr_t
hdr
¶ Event header.
-
uint16_t
peer_mtu
¶ Transport channel L2CAP MTU of the peer.
-
uint16_t
lcid
¶ L2CAP LCID for media channel.
-
wiced_bt_avdt_evt_hdr_t
-
struct
wiced_bt_avdt_security_t
¶ - #include <>
Data for AVDT_SECURITY_IND_EVT and AVDT_SECURITY_CFM_EVT.
Public Members
-
wiced_bt_avdt_evt_hdr_t
hdr
¶ Event header.
-
uint8_t *
p_data
¶ Pointer to security data.
-
uint16_t
len
¶ Length in bytes of the security data.
-
wiced_bt_avdt_evt_hdr_t
-
struct
wiced_bt_avdt_discover_t
¶ - #include <>
Data for AVDT_DISCOVER_CFM_EVT.
Public Members
-
wiced_bt_avdt_evt_hdr_t
hdr
¶ Event header.
-
wiced_bt_avdt_sep_info_t *
p_sep_info
¶ Pointer to SEP information.
-
uint8_t
num_seps
¶ Number of stream endpoints.
-
wiced_bt_avdt_evt_hdr_t
-
struct
wiced_bt_avdt_delay_rpt_t
¶ - #include <>
Data for AVDT_DELAY_REPORT_EVT.
-
struct
wiced_bt_avdt_write_cfm_t
¶ - #include <>
This data structure is associated with the AVDT_WRITE_CFM_EVT.
-
union
wiced_bt_avdt_ctrl_t
¶ - #include <>
Data for AVDT event notifications.
Public Members
-
wiced_bt_avdt_evt_hdr_t
hdr
¶ Generic event data.
-
wiced_bt_avdt_discover_t
discover_cfm
¶ Discovery confirm (AVDT_DISCOVER_CFM_EVT)
-
wiced_bt_avdt_config_t
getcap_cfm
¶ Get Capabilities result (AVDT_GETCAP_CFM_EVT)
-
wiced_bt_avdt_open_t
open_cfm
¶ Open confirm (AVDT_OPEN_CFM_EVT)
-
wiced_bt_avdt_open_t
open_ind
¶ Open indication (AVDT_OPEN_IND_EVT)
-
wiced_bt_avdt_setconfig_t
config_ind
¶ Configuration indication (AVDT_CONFIG_IND_EVT)
-
wiced_bt_avdt_evt_hdr_t
start_cfm
¶ Start confirm (AVDT_START_CFM_EVT)
-
wiced_bt_avdt_evt_hdr_t
start_ind
¶ Start indication (AVDT_START_IND_EVT)
-
wiced_bt_avdt_evt_hdr_t
suspend_cfm
¶ Suspend confirm (AVDT_SUSPEND_CFM_EVT)
-
wiced_bt_avdt_evt_hdr_t
close_cfm
¶ Close confirm (AVDT_CLOSE_CFM_EVT)
-
wiced_bt_avdt_config_t
reconfig_cfm
¶ Reconfiguration confirm (AVDT_RECONFIG_CFM_EVT)
-
wiced_bt_avdt_config_t
reconfig_ind
¶ Reconfiguration indication (AVDT_RECONFIG_IND_EVT)
-
wiced_bt_avdt_security_t
security_cfm
¶ Security confirm (AVDT_SECURITY_CFM_EVT)
-
wiced_bt_avdt_security_t
security_ind
¶ Security indication (AVDT_SECURITY_IND_EVT)
-
wiced_bt_avdt_evt_hdr_t
connect_ind
¶ Connect Indication (AVDT_CONNECT_IND_EVT)
-
wiced_bt_avdt_evt_hdr_t
disconnect_ind
¶ Disconnect Indication (AVDT_DISCONNECT_IND_EVT)
-
wiced_bt_avdt_evt_hdr_t
report_conn
¶ Reporting channel connected (AVDT_REPORT_CONN_EVT)
-
wiced_bt_avdt_delay_rpt_t
delay_rpt_cmd
¶ Delay report received (AVDT_DELAY_REPORT_EVT)
-
wiced_bt_avdt_write_cfm_t
write_cfm
¶ Media Buffer write confirmation (AVDT_WRITE_CFM_EVT)
-
wiced_bt_avdt_evt_hdr_t
-
struct
wiced_bt_avdt_cs_t
¶ - #include <>
This structure contains information required when a stream is created.
It is passed to the wiced_bt_avdt_create_stream() function.
Public Members
-
wiced_bt_avdt_cfg_t
cfg
¶ SEP configuration.
-
wiced_bt_avdt_ctrl_cback_t *
p_avdt_ctrl_cback
¶ Control callback function.
-
wiced_bt_avdt_data_cback_t *
p_avdt_data_cback
¶ Data callback function.
-
uint8_t
tsep
¶ SEP type (see Stream endpoint types)
-
uint8_t
media_type
¶ Media type (see Media types)
-
uint16_t
nsc_mask
¶ Non-supported protocol command messages mask (see Non-supported commands mask)
-
wiced_bt_avdt_cfg_t
-