Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
a2dp.h File Reference

Advanced Audio Distribution Profile header. More...

Go to the source code of this file.

Data Structures

struct  bt_a2dp_codec_ie
 codec information elements for the endpoint More...
struct  bt_a2dp_codec_cfg
 The endpoint configuration. More...
struct  bt_a2dp_ep
 Stream End Point. More...
struct  bt_a2dp_ep_info
struct  bt_a2dp_discover_param
struct  bt_a2dp_cb
 The connecting callback. More...
struct  bt_a2dp_stream
 A2DP Stream. More...
struct  bt_a2dp_stream_ops
 The stream endpoint related operations. More...

Macros

#define BT_A2DP_SBC_IE_LENGTH   (4U)
 SBC IE length.
#define BT_A2DP_MPEG_1_2_IE_LENGTH   (4U)
 MPEG1,2 IE length.
#define BT_A2DP_MPEG_2_4_IE_LENGTH   (6U)
 MPEG2,4 IE length.
#define BT_A2DP_MAX_IE_LENGTH   (8U)
 The max IE (Codec Info Element) length.
#define BT_A2DP_EP_INIT(_role, _codec, _capability, _delay_report)
 define the audio endpoint
#define BT_A2DP_SINK_EP_INIT(_codec, _capability, _delay_report)
 define the audio sink endpoint
#define BT_A2DP_SOURCE_EP_INIT(_codec, _capability, _delay_report)
 define the audio source endpoint
#define BT_A2DP_SBC_SINK_EP(_name, _freq, _ch_mode, _blk_len, _subband, _alloc_mthd, _min_bitpool, _max_bitpool, _delay_report)
 define the SBC sink endpoint that can be used as bt_a2dp_register_endpoint's parameter.
#define BT_A2DP_SBC_SOURCE_EP(_name, _freq, _ch_mode, _blk_len, _subband, _alloc_mthd, _min_bitpool, _max_bitpool, _delay_report)
 define the SBC source endpoint that can be used as bt_a2dp_register_endpoint's parameter.
#define BT_A2DP_SBC_SINK_EP_DEFAULT(_name)
 define the default SBC sink endpoint that can be used as bt_a2dp_register_endpoint's parameter.
#define BT_A2DP_SBC_SOURCE_EP_DEFAULT(_name)
 define the default SBC source endpoint that can be used as bt_a2dp_register_endpoint's parameter.
#define BT_A2DP_SBC_EP_CFG(_name, _freq_cfg, _ch_mode_cfg, _blk_len_cfg, _subband_cfg, _alloc_mthd_cfg, _min_bitpool_cfg, _max_bitpool_cfg)
 define the SBC default configuration.
#define BT_A2DP_SBC_EP_CFG_DEFAULT(_name, _freq_cfg)
 define the SBC default configuration.

Typedefs

typedef uint8_t(* bt_a2dp_discover_ep_cb) (struct bt_a2dp *a2dp, struct bt_a2dp_ep_info *info, struct bt_a2dp_ep **ep)
 Called when a stream endpoint is discovered.

Enumerations

enum  bt_a2dp_err_code {
  BT_A2DP_INVALID_CODEC_TYPE = 0xC1 , BT_A2DP_NOT_SUPPORTED_CODEC_TYPE = 0xC2 , BT_A2DP_INVALID_SAMPLING_FREQUENCY = 0xC3 , BT_A2DP_NOT_SUPPORTED_SAMPLING_FREQUENCY = 0xC4 ,
  BT_A2DP_INVALID_CHANNEL_MODE = 0xC5 , BT_A2DP_NOT_SUPPORTED_CHANNEL_MODE = 0xC6 , BT_A2DP_INVALID_SUBBANDS = 0xC7 , BT_A2DP_NOT_SUPPORTED_SUBBANDS = 0xC8 ,
  BT_A2DP_INVALID_ALLOCATION_METHOD = 0xC9 , BT_A2DP_NOT_SUPPORTED_ALLOCATION_METHOD = 0xCA , BT_A2DP_INVALID_MINIMUM_BITPOOL_VALUE = 0xCB , BT_A2DP_NOT_SUPPORTED_MINIMUM_BITPOOL_VALUE = 0xCC ,
  BT_A2DP_INVALID_MAXIMUM_BITPOOL_VALUE = 0xCD , BT_A2DP_NOT_SUPPORTED_MAXIMUM_BITPOOL_VALUE = 0xCE , BT_A2DP_INVALID_LAYER = 0xCF , BT_A2DP_NOT_SUPPORTED_LAYER = 0xD0 ,
  BT_A2DP_NOT_SUPPORTED_CRC = 0xD1 , BT_A2DP_NOT_SUPPORTED_MPF = 0xD2 , BT_A2DP_NOT_SUPPORTED_VBR = 0xD3 , BT_A2DP_INVALID_BIT_RATE = 0xD4 ,
  BT_A2DP_NOT_SUPPORTED_BIT_RATE = 0xD5 , BT_A2DP_INVALID_OBJECT_TYPE = 0xD6 , BT_A2DP_NOT_SUPPORTED_OBJECT_TYPE = 0xD7 , BT_A2DP_INVALID_CHANNELS = 0xD8 ,
  BT_A2DP_NOT_SUPPORTED_CHANNELS = 0xD9 , BT_A2DP_INVALID_VERSION = 0xDA , BT_A2DP_NOT_SUPPORTED_VERSION = 0xDB , BT_A2DP_NOT_SUPPORTED_MAXIMUM_SUL = 0xDC ,
  BT_A2DP_INVALID_BLOCK_LENGTH = 0xDD , BT_A2DP_INVALID_CP_TYPE = 0xE0 , BT_A2DP_INVALID_CP_FORMAT = 0xE1 , BT_A2DP_INVALID_CODEC_PARAMETER = 0xE2 ,
  BT_A2DP_NOT_SUPPORTED_CODEC_PARAMETER = 0xE3 , BT_A2DP_INVALID_DRC = 0xE4 , BT_A2DP_NOT_SUPPORTED_DRC = 0xE5
}
 A2DP error code. More...
enum  bt_a2dp_codec_type {
  BT_A2DP_SBC = 0x00 , BT_A2DP_MPEG1 = 0x01 , BT_A2DP_MPEG2 = 0x02 , BT_A2DP_MPEGD = 0x03 ,
  BT_A2DP_ATRAC = 0x04 , BT_A2DP_VENDOR = 0xff
}
 Codec Type. More...
enum  { BT_A2DP_DISCOVER_EP_STOP = 0 , BT_A2DP_DISCOVER_EP_CONTINUE }
 Helper enum to be used as return value of bt_a2dp_discover_ep_cb. More...

Functions

struct bt_a2dp * bt_a2dp_connect (struct bt_conn *conn)
 A2DP Connect.
int bt_a2dp_disconnect (struct bt_a2dp *a2dp)
 disconnect l2cap a2dp
int bt_a2dp_register_ep (struct bt_a2dp_ep *ep, uint8_t media_type, uint8_t sep_type)
 Endpoint Registration.
int bt_a2dp_register_cb (struct bt_a2dp_cb *cb)
 register callback.
struct bt_conn * bt_a2dp_get_conn (struct bt_a2dp *a2dp)
 Obtain the ACL connection corresponding to A2DP.
int bt_a2dp_discover (struct bt_a2dp *a2dp, struct bt_a2dp_discover_param *param)
 Discover remote endpoints.
void bt_a2dp_stream_cb_register (struct bt_a2dp_stream *stream, struct bt_a2dp_stream_ops *ops)
 Register Audio callbacks for a stream.
int bt_a2dp_stream_config (struct bt_a2dp *a2dp, struct bt_a2dp_stream *stream, struct bt_a2dp_ep *local_ep, struct bt_a2dp_ep *remote_ep, struct bt_a2dp_codec_cfg *config)
 configure endpoint.
int bt_a2dp_stream_get_config (struct bt_a2dp_stream *stream)
 get config of the stream
int bt_a2dp_stream_establish (struct bt_a2dp_stream *stream)
 establish a2dp streamer.
int bt_a2dp_stream_release (struct bt_a2dp_stream *stream)
 release a2dp streamer.
int bt_a2dp_stream_start (struct bt_a2dp_stream *stream)
 start a2dp streamer.
int bt_a2dp_stream_suspend (struct bt_a2dp_stream *stream)
 suspend a2dp streamer.
int bt_a2dp_stream_reconfig (struct bt_a2dp_stream *stream, struct bt_a2dp_codec_cfg *config)
 re-configure a2dp streamer
int bt_a2dp_stream_abort (struct bt_a2dp_stream *stream)
 abort a2dp streamer.
uint32_t bt_a2dp_get_mtu (struct bt_a2dp_stream *stream)
 get the stream l2cap mtu
int bt_a2dp_stream_send (struct bt_a2dp_stream *stream, struct net_buf *buf, uint16_t seq_num, uint32_t ts)
 send a2dp media data
struct net_bufbt_a2dp_stream_create_pdu (struct net_buf_pool *pool, k_timeout_t timeout)
 Allocate a net_buf for bt_a2dp_stream_send.
int bt_a2dp_stream_delay_report (struct bt_a2dp_stream *stream, uint16_t delay)
 send delay report

Detailed Description

Advanced Audio Distribution Profile header.

Advanced Audio Distribution Profile (A2DP)