Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
A2DP SBC Support

This section describes A2DP Low complexity subband codec (SBC) API. More...

Data Structures

struct  wiced_bt_a2d_sbc_cie_t
 data type for the SBC Codec Information Element More...
 

Macros

#define A2D_SBC_MPL_HDR_LEN   1
 the length of the SBC Media Payload header. More...
 
#define A2D_SBC_INFO_LEN   6
 the LOSC of SBC media codec capabilitiy
 
#define A2D_SBC_IE_MIN_BITPOOL   2
 Min Bitpool Value.
 
#define A2D_SBC_IE_MAX_BITPOOL   250
 Max Bitpool Value.
 
#define A2D_SBC_HDR_F_MSK   0x80
 SBC Fragmented packet mask.
 
#define A2D_SBC_HDR_S_MSK   0x40
 SBC starting packet mask.
 
#define A2D_SBC_HDR_L_MSK   0x20
 SBC last packet mask.
 
#define A2D_SBC_HDR_NUM_MSK   0x0F
 SBC number of frame mask.
 

Functions

void wiced_bt_a2d_sbc_chk_fr_init (uint8_t *p_pkt)
 Check if control block descrambling needs to be initiated. More...
 
void wiced_bt_a2d_sbc_descramble (uint8_t *p_pkt, uint16_t len)
 Descramble packet. More...
 
wiced_bt_a2d_status_t wiced_bt_a2d_bld_sbc_info (uint8_t media_type, const wiced_bt_a2d_sbc_cie_t *p_ie, uint8_t *p_result)
 Build SBC Media Codec Capabilities byte sequence (beginning from the LOSC octet) More...
 
wiced_bt_a2d_status_t wiced_bt_a2d_pars_sbc_info (wiced_bt_a2d_sbc_cie_t *p_ie, uint8_t *p_info, wiced_bool_t for_caps)
 Parse SBC Media Codec Capabilities byte sequence (beginning from the LOSC octet) More...
 
void wiced_bt_a2d_bld_sbc_mpl_hdr (uint8_t *p_dst, wiced_bool_t frag, wiced_bool_t start, wiced_bool_t last, uint8_t num)
 Build SBC Media Payload header. More...
 
void wiced_bt_a2d_pars_sbc_mpl_hdr (uint8_t *p_src, wiced_bool_t *p_frag, wiced_bool_t *p_start, wiced_bool_t *p_last, uint8_t *p_num)
 Parse SBC Media Payload header. More...
 

SBC Sampling Frequency.

#define A2D_SBC_IE_SAMP_FREQ_MSK   0xF0
 b7-b4 sampling frequency
 
#define A2D_SBC_IE_SAMP_FREQ_16   0x80
 b7:16 kHz
 
#define A2D_SBC_IE_SAMP_FREQ_32   0x40
 b6:32 kHz
 
#define A2D_SBC_IE_SAMP_FREQ_44   0x20
 b5:44.1kHz
 
#define A2D_SBC_IE_SAMP_FREQ_48   0x10
 b4:48 kHz
 

SBC Channel Mode.

#define A2D_SBC_IE_CH_MD_MSK   0x0F
 b3-b0 channel mode
 
#define A2D_SBC_IE_CH_MD_MONO   0x08
 b3: mono
 
#define A2D_SBC_IE_CH_MD_DUAL   0x04
 b2: dual
 
#define A2D_SBC_IE_CH_MD_STEREO   0x02
 b1: stereo
 
#define A2D_SBC_IE_CH_MD_JOINT   0x01
 b0: joint stereo
 

SBC Block Length.

#define A2D_SBC_IE_BLOCKS_MSK   0xF0
 b7-b4 number of blocks
 
#define A2D_SBC_IE_BLOCKS_4   0x80
 4 blocks
 
#define A2D_SBC_IE_BLOCKS_8   0x40
 8 blocks
 
#define A2D_SBC_IE_BLOCKS_12   0x20
 12blocks
 
#define A2D_SBC_IE_BLOCKS_16   0x10
 16blocks
 

SBC Subband Number.

#define A2D_SBC_IE_SUBBAND_MSK   0x0C
 b3-b2 number of subbands
 
#define A2D_SBC_IE_SUBBAND_4   0x08
 b3: 4
 
#define A2D_SBC_IE_SUBBAND_8   0x04
 b2: 8
 

SBC Allocation Method.

#define A2D_SBC_IE_ALLOC_MD_MSK   0x03
 b1-b0 allocation mode
 
#define A2D_SBC_IE_ALLOC_MD_S   0x02
 b1: SNR
 
#define A2D_SBC_IE_ALLOC_MD_L   0x01
 b0: loundess
 

Detailed Description

This section describes A2DP Low complexity subband codec (SBC) API.

Macro Definition Documentation

#define A2D_SBC_MPL_HDR_LEN   1

the length of the SBC Media Payload header.

Function Documentation

wiced_bt_a2d_status_t wiced_bt_a2d_bld_sbc_info ( uint8_t  media_type,
const wiced_bt_a2d_sbc_cie_t p_ie,
uint8_t *  p_result 
)

Build SBC Media Codec Capabilities byte sequence (beginning from the LOSC octet)

Parameters
[in]media_type: Media type, audio or multimedia
[in]p_ie: Pointer to the SBC codec information element
[out]p_result: Pointer to the built codec info byte stream
Returns
Status code (see A2DP status codes) A2D_SUCCESS if successful, otherwise error.
void wiced_bt_a2d_bld_sbc_mpl_hdr ( uint8_t *  p_dst,
wiced_bool_t  frag,
wiced_bool_t  start,
wiced_bool_t  last,
uint8_t  num 
)

Build SBC Media Payload header.

Parameters
[in]frag: 1, if fragmented. 0, otherwise.
[in]start: 1, if the starting packet of a fragmented frame.
[in]last: 1, if the last packet of a fragmented frame.
[in]num: If frag is 1, this is the number of remaining fragments (including this fragment) of this frame. If frag is 0, this is the number of frames in this packet.
[out]p_dst: Pointer to the built media payload header byte
Returns
None
wiced_bt_a2d_status_t wiced_bt_a2d_pars_sbc_info ( wiced_bt_a2d_sbc_cie_t p_ie,
uint8_t *  p_info,
wiced_bool_t  for_caps 
)

Parse SBC Media Codec Capabilities byte sequence (beginning from the LOSC octet)

Parameters
[in]p_info: Pointer to the byte stream to parse
[in]for_caps: True if the byte stream is for get capabilities response
[out]p_ie: Pointer to the parsed codec info byte sequence
Returns
Status code (see A2DP status codes) A2D_SUCCESS if successful, otherwise error.
void wiced_bt_a2d_pars_sbc_mpl_hdr ( uint8_t *  p_src,
wiced_bool_t p_frag,
wiced_bool_t p_start,
wiced_bool_t p_last,
uint8_t *  p_num 
)

Parse SBC Media Payload header.

Parameters
[in]p_src: Pointer to the byte stream to parse
[out]p_frag: 1, if fragmented. 0, otherwise.
[out]p_start: 1, if the starting packet of a fragmented frame.
[out]p_last: 1, if the last packet of a fragmented frame.
[out]p_num: If frag is 1, this is the number of remaining fragments (including this fragment) of this frame. If frag is 0, this is the number of frames in this packet.
Returns
None
void wiced_bt_a2d_sbc_chk_fr_init ( uint8_t *  p_pkt)

Check if control block descrambling needs to be initiated.

Parameters
[in]p_pkt: Pointer to the incoming data
Returns
None
void wiced_bt_a2d_sbc_descramble ( uint8_t *  p_pkt,
uint16_t  len 
)

Descramble packet.

Parameters
[in]p_pkt: Pointer to the incoming data
[in]len: Size of the data
Returns
None