A2DP Interface Functions

[English]

A2DP_IF API Brief

Application

Brief

a2dp_if_snk_connect()

A2DP sink connect API

a2dp_if_snk_disconnect()

A2DP sink disconnect API

a2dp_if_snk_set_active_device()

Set active device to the a2dp stack

a2dp_if_snk_register_stack_callback()

A2DP sink register event callback API

a2dp_if_snk_init()

A2DP sink init function API

a2dp_if_get_sync_len()

return the profile sync used max buffer size

a2dp_if_conn_sync()

TWS master used to send sync profile data to slave

a2dp_if_conn_restore()

TWS slave used to rebuild its host stack

a2dp_if_conn_restore_specific()

TWS slave update A2DP connection handle and recover relevant settings

a2dp_if_snk_stream_is_started()

check A2DP music is streaming or not

a2dp_if_set_delay_rpt()

update delay report aluje

A2DP_IF API Reference

Header File

Functions

btif_ret_t a2dp_if_snk_connect(btif_bd_addr_t *p_addr)

a2dp_if_snk_connect brief description

A2DP sink connect API

参数:

p_addr[in] remote BT MAC address

返回值:
  • 0 – success

  • other – fail

返回:

result

btif_ret_t a2dp_if_snk_disconnect(uint16_t handle)

a2dp_if_snk_disconnect brief description

A2DP sink disconnect API

参数:

handle[in] connection handle

返回值:
  • 0 – success

  • other – fail

返回:

result

btif_ret_t a2dp_if_snk_set_active_device(uint16_t handle, bool active)

a2dp_if_snk_set_active_device brief description

Set active device to the a2dp stack

参数:
  • handle[in] acl handle

  • active[in] true:active false:not Active

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

void a2dp_if_snk_register_stack_callback(btif_a2dp_register_t *p_callback)

a2dp_if_snk_register_stack_callback brief description

A2DP sink register event callback API

参数:

p_callback[in] strcut of callback function

返回:

N/A

btif_ret_t a2dp_if_snk_init(btif_a2dp_snk_register_sep_t *p_reg_sep, uint8_t sep_cnt)

a2dp_if_snk_init brief description

A2DP sink init function API

参数:
  • p_reg_sep[in] configured setting of stream end point array

  • sep_cnt[in] count of stream end point

返回值:
  • 0 – success

  • other – fail

返回:

result

uint16_t a2dp_if_get_sync_len(btif_bd_addr_t *p_addr)

a2dp_if_get_sync_len brief description

return the profile sync used max buffer size

参数:

p_addr[in] remote BT MAC address

返回:

data length

btif_ret_t a2dp_if_conn_sync(btif_bd_addr_t *p_addr, uint8_t *p_buff, uint16_t buff_len, uint16_t *p_length)

a2dp_if_conn_sync brief description

TWS master used to send sync profile data to slave

参数:
  • addr[in] remote BT MAC addresss

  • p_buff[out] buffer used to sync profile data

  • buff_len[in] p_buff allocated length

  • p_length[out] sync profile data length will be sent

返回值:
  • 0 – success

  • other – fail

返回:

result

btif_ret_t a2dp_if_conn_restore(btif_bd_addr_t *p_addr, uint8_t *p_buff, uint16_t length)

a2dp_if_conn_restore brief description

TWS slave used to rebuild its host stack

参数:
  • addr[in] remote BT MAC address

  • p_buff[in] sync profile data

  • length[in] p_buff data length

返回值:
  • 0 – success

  • other – fail

返回:

result

btif_ret_t a2dp_if_conn_restore_specific(btif_bd_addr_t *p_addr, uint16_t handle)

a2dp_if_conn_restore_specific brief description

TWS slave update A2DP connection handle and recover relevant settings

参数:
  • p_addr[in] remote BT MAC address

  • handle[in] connection handle

返回值:
  • 0 – success

  • other – fail

返回:

result

bool a2dp_if_snk_stream_is_started(uint16_t handle)

a2dp_if_snk_stream_is_started brief description

check A2DP music is streaming or not

参数:

handle[in] connection handle

返回值:
  • true – start

  • fail – stop

返回:

result

btif_ret_t a2dp_if_set_delay_rpt(uint16_t handle, uint16_t delay_rpt_100us)

a2dp_if_set_delay_rpt brief description

update delay report aluje

参数:
  • handle[in] connection handle

  • delay_rpt_100us[in] delay report value(unit:100us)

返回:

result

Structures

struct btif_a2dp_cb_hdr_t

A2DP header data struct definition.

Public Members

btif_a2dp_evt_t event

event index

uint16_t handle

connection handle

uint16_t scid

source CID

struct btif_a2dp_conn_cb_t

A2DP connect status data struct definition.

Public Members

btif_a2dp_cb_hdr_t hdr

A2DP header data struct

btif_bd_addr_t addr

remote BT MAC address

uint8_t status

status result @btif_ret_t

struct btif_a2dp_sec_ctrl_cb_t

A2DP security control data struct definition.

Public Members

btif_a2dp_cb_hdr_t hdr

A2DP header data struct

uint8_t len

length of p_data

const uint8_t *p_data

security control data buffer

struct btif_a2dp_media_data_cb_t

A2DP media data struct definition.

Public Members

btif_a2dp_cb_hdr_t hdr

A2DP header data struct

uint16_t len

length of p_data

const uint8_t *p_data

media data buffer

struct btif_a2dp_sep_cfg_cb_t

A2DP set configure data struct definition.

Public Members

btif_a2dp_cb_hdr_t hdr

A2DP header data struct

uint8_t remote_seid

remote stream end point ID

uint8_t local_seid

local stream end point ID

uint8_t media_type

media type @btif_a2dp_media_type_t

uint8_t codec_type

codec type

uint8_t data_len

data length of p_data

const uint8_t *p_data

configurtion data buffer

struct btif_a2dp_cp_cb_t

A2DP content protection data struct definition.

Public Members

btif_a2dp_cb_hdr_t hdr

A2DP header data struct

uint8_t is_enable

value for enable or disable

uint16_t cp_type

content protection type @btif_a2dp_cp_type_t

uint8_t data_len

data length of p_data

const uint8_t *p_data

content protection data buffer

struct btif_a2dp_recover_cb_t

A2DP recover callback data struct definition.

Public Members

btif_a2dp_cb_hdr_t hdr

A2DP header data struct

bool active_device

flag for playing music

struct btif_a2dp_snk_register_sep_t

A2DP sink SEP setting data struct definition.

Public Members

btif_a2dp_media_type_t media_type

medit type

btif_a2dp_codec_type_t codec_type

codec type

uint16_t codec_cap_len

length of codec capability

const uint8_t *p_codec_cap

data pointer for codec capability

btif_a2dp_cp_type_t cp_type

content protection type

uint16_t cp_val_len

content protection value length

const uint8_t *p_cp_val

data pointer for content protection value

struct btif_a2dp_register_t

callback struct definition

Public Members

dl_list_t dlst_node

node for application handler will be linked to orthers

btif_a2dp_event_callback callback

function pointer for callback function

Macros

BTIF_A2DP_EVT_SIG_CONNECT

callback struct see @btif_a2dp_conn_cb_t

BTIF_A2DP_EVT_SIG_DISCONNECT

callback struct see @btif_a2dp_conn_cb_t

BTIF_A2DP_EVT_MEDIA_CONNECT

callback struct see @btif_a2dp_conn_cb_t

BTIF_A2DP_EVT_MEDIA_DISCONNECT

callback struct see @btif_a2dp_conn_cb_t

BTIF_A2DP_EVT_SIG_DELAY_RPT_SUPP

callback struct see @btif_a2dp_cb_hdr_t

BTIF_A2DP_EVT_SIG_DELAY_RPT_VAL_CHANGED

callback struct see @ NULL

BTIF_A2DP_EVT_SIG_CP

callback struct see @btif_a2dp_cp_cb_t

BTIF_A2DP_EVT_SIG_SEC_CTRL

callback struct see @btif_a2dp_sec_ctrl_cb_t

BTIF_A2DP_EVT_MEDIA_CODEC_CFG

callback struct see @btif_a2dp_sep_cfg_cb_t

BTIF_A2DP_EVT_STREAM_START

callback struct see @btif_a2dp_cb_hdr_t

BTIF_A2DP_EVT_STREAM_SUSPEND

callback struct see @btif_a2dp_cb_hdr_t

BTIF_A2DP_EVT_RECOVER_START

callback struct see @btif_a2dp_cb_hdr_t

BTIF_A2DP_EVT_RECOVER_DONE

callback struct see @btif_a2dp_recover_cb_t

BTIF_A2DP_EVT_MEDIA_DATA

callback struct see @btif_a2dp_media_data_cb_t

Type Definitions

typedef uint8_t btif_a2dp_evt_t