A2DP SBC Support

group wicedbt_a2dp_sbc

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

SBC Sampling Frequency.

A2D_SBC_IE_SAMP_FREQ_MSK

b7-b4 sampling frequency

A2D_SBC_IE_SAMP_FREQ_16

b7:16 kHz

A2D_SBC_IE_SAMP_FREQ_32

b6:32 kHz

A2D_SBC_IE_SAMP_FREQ_44

b5:44.1kHz

A2D_SBC_IE_SAMP_FREQ_48

b4:48 kHz

SBC Channel Mode.

A2D_SBC_IE_CH_MD_MSK

b3-b0 channel mode

A2D_SBC_IE_CH_MD_MONO

b3: mono

A2D_SBC_IE_CH_MD_DUAL

b2: dual

A2D_SBC_IE_CH_MD_STEREO

b1: stereo

A2D_SBC_IE_CH_MD_JOINT

b0: joint stereo

SBC Block Length.

A2D_SBC_IE_BLOCKS_MSK

b7-b4 number of blocks

A2D_SBC_IE_BLOCKS_4

4 blocks

A2D_SBC_IE_BLOCKS_8

8 blocks

A2D_SBC_IE_BLOCKS_12

12blocks

A2D_SBC_IE_BLOCKS_16

16blocks

SBC Subband Number.

A2D_SBC_IE_SUBBAND_MSK

b3-b2 number of subbands

A2D_SBC_IE_SUBBAND_4

b3: 4

A2D_SBC_IE_SUBBAND_8

b2: 8

SBC Allocation Method.

A2D_SBC_IE_ALLOC_MD_MSK

b1-b0 allocation mode

A2D_SBC_IE_ALLOC_MD_S

b1: SNR

A2D_SBC_IE_ALLOC_MD_L

b0: loundess

Defines

A2D_SBC_MPL_HDR_LEN

the length of the SBC Media Payload header.

A2D_SBC_INFO_LEN

the LOSC of SBC media codec capabilitiy

A2D_SBC_IE_MIN_BITPOOL

Min Bitpool Value.

A2D_SBC_IE_MAX_BITPOOL

Max Bitpool Value.

A2D_SBC_HDR_F_MSK

SBC Fragmented packet mask.

A2D_SBC_HDR_S_MSK

SBC starting packet mask.

A2D_SBC_HDR_L_MSK

SBC last packet mask.

A2D_SBC_HDR_NUM_MSK

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.

Parameters

p_pkt[in] : Pointer to the incoming data

Returns

None

void wiced_bt_a2d_sbc_descramble(uint8_t *p_pkt, uint16_t len)

Descramble packet.

Parameters
  • p_pkt[in] : Pointer to the incoming data

  • len[in] : Size of the data

Returns

None

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
  • media_type[in] : Media type, audio or multimedia

  • p_ie[in] : Pointer to the SBC codec information element

  • p_result[out] : Pointer to the built codec info byte stream

Returns

Status code (see A2DP status codes) A2D_SUCCESS if successful, otherwise error.

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
  • p_info[in] : Pointer to the byte stream to parse

  • for_caps[in] : True if the byte stream is for get capabilities response

  • p_ie[out] : 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_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
  • frag[in] : 1, if fragmented. 0, otherwise.

  • start[in] : 1, if the starting packet of a fragmented frame.

  • last[in] : 1, if the last packet of a fragmented frame.

  • num[in] : 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.

  • p_dst[out] : Pointer to the built media payload header byte

Returns

None

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
  • p_src[in] : Pointer to the byte stream to parse

  • p_frag[out] : 1, if fragmented. 0, otherwise.

  • p_start[out] : 1, if the starting packet of a fragmented frame.

  • p_last[out] : 1, if the last packet of a fragmented frame.

  • p_num[out] : 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

struct wiced_bt_a2d_sbc_cie_t
#include <>

data type for the SBC Codec Information Element

Public Members

uint8_t samp_freq

Sampling frequency A2D_SBC_SF.

uint8_t ch_mode

Channel mode A2D_SBC_CH_MD.

uint8_t block_len

Block length A2D_SBC_BLOCK_LEN.

uint8_t num_subbands

Number of subbands A2D_SBC_SUBBAND_NUM.

uint8_t alloc_mthd

Allocation method A2D_SBC_ALLOC_MD.

uint8_t max_bitpool

Maximum bitpool.

uint8_t min_bitpool

Minimum bitpool.