mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
change(bt/Bluedroid): Update AVRCP version to 1.5
This commit is contained in:
parent
73551a70cc
commit
d666536a21
@ -232,7 +232,7 @@ void bta_ar_dereg_avct(tBTA_SYS_ID sys_id)
|
||||
**
|
||||
******************************************************************************/
|
||||
void bta_ar_reg_avrc(UINT16 service_uuid, char *service_name, char *provider_name,
|
||||
UINT16 categories, tBTA_SYS_ID sys_id)
|
||||
UINT16 categories, tBTA_SYS_ID sys_id, BOOLEAN browsing_en)
|
||||
{
|
||||
UINT8 mask = bta_ar_id (sys_id);
|
||||
UINT8 temp[8], *p;
|
||||
@ -245,7 +245,7 @@ void bta_ar_reg_avrc(UINT16 service_uuid, char *service_name, char *provider_nam
|
||||
if (bta_ar_cb.sdp_tg_handle == 0) {
|
||||
bta_ar_cb.tg_registered = mask;
|
||||
bta_ar_cb.sdp_tg_handle = SDP_CreateRecord();
|
||||
AVRC_AddRecord(service_uuid, service_name, provider_name, categories, bta_ar_cb.sdp_tg_handle);
|
||||
AVRC_AddRecord(service_uuid, service_name, provider_name, categories, bta_ar_cb.sdp_tg_handle, browsing_en);
|
||||
bta_sys_add_uuid(service_uuid);
|
||||
}
|
||||
/* only one TG is allowed (first-come, first-served).
|
||||
@ -255,7 +255,7 @@ void bta_ar_reg_avrc(UINT16 service_uuid, char *service_name, char *provider_nam
|
||||
categories = bta_ar_cb.ct_categories[0] | bta_ar_cb.ct_categories[1];
|
||||
if (bta_ar_cb.sdp_ct_handle == 0) {
|
||||
bta_ar_cb.sdp_ct_handle = SDP_CreateRecord();
|
||||
AVRC_AddRecord(service_uuid, service_name, provider_name, categories, bta_ar_cb.sdp_ct_handle);
|
||||
AVRC_AddRecord(service_uuid, service_name, provider_name, categories, bta_ar_cb.sdp_ct_handle, browsing_en);
|
||||
bta_sys_add_uuid(service_uuid);
|
||||
} else {
|
||||
/* multiple CTs are allowed.
|
||||
|
@ -94,7 +94,8 @@ const tBTA_AV_CFG bta_av_cfg = {
|
||||
6, /* AVDTP audio channel max data queue size */
|
||||
BTA_AV_MAX_VDP_MTU, /* AVDTP video transport channel MTU at L2CAP */
|
||||
600, /* AVDTP video transport channel flush timeout */
|
||||
FALSE, /* TRUE, to accept AVRC 1.3 group nevigation command */
|
||||
FALSE, /* TRUE, to accept AVRC 1.3 group nevigation command */
|
||||
FALSE, /* FALSE, does not support browsing channel */
|
||||
2, /* company id count in p_meta_co_ids */
|
||||
BTA_AV_RC_PASS_RSP_CODE,/* the default response code for pass through commands */
|
||||
bta_av_meta_caps_co_ids,/* the metadata Get Capabilities response for company id */
|
||||
|
@ -585,10 +585,10 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
|
||||
(UINT8)(bta_av_cb.sec_mask & (~BTA_SEC_AUTHORIZE)), BTA_ID_AV);
|
||||
if (p_data->api_reg.tsep == AVDT_TSEP_SRC) {
|
||||
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REM_CTRL_TARGET, "AV Remote Control Target\n", NULL,
|
||||
p_bta_av_cfg->avrc_src_tg_cat, BTA_ID_AV);
|
||||
p_bta_av_cfg->avrc_src_tg_cat, BTA_ID_AV, p_bta_av_cfg->avrc_br);
|
||||
} else {
|
||||
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REM_CTRL_TARGET, "AV Remote Control Target\n", NULL,
|
||||
p_bta_av_cfg->avrc_snk_tg_cat, BTA_ID_AV);
|
||||
p_bta_av_cfg->avrc_snk_tg_cat, BTA_ID_AV, p_bta_av_cfg->avrc_br);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -721,10 +721,10 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
|
||||
/* create an SDP record as AVRC CT. */
|
||||
if (p_data->api_reg.tsep == AVDT_TSEP_SRC) {
|
||||
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REMOTE_CONTROL, "AV Remote Control Controller\n", NULL,
|
||||
p_bta_av_cfg->avrc_src_ct_cat, BTA_ID_AV);
|
||||
p_bta_av_cfg->avrc_src_ct_cat, BTA_ID_AV, p_bta_av_cfg->avrc_br);
|
||||
} else {
|
||||
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REMOTE_CONTROL, "AV Remote Control Controller\n", NULL,
|
||||
p_bta_av_cfg->avrc_snk_ct_cat, BTA_ID_AV);
|
||||
p_bta_av_cfg->avrc_snk_ct_cat, BTA_ID_AV, p_bta_av_cfg->avrc_br);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -120,8 +120,8 @@ extern void bta_ar_dereg_avct(tBTA_SYS_ID sys_id);
|
||||
** Returns void
|
||||
**
|
||||
******************************************************************************/
|
||||
extern void bta_ar_reg_avrc(UINT16 service_uuid, char *p_service_name,
|
||||
char *p_provider_name, UINT16 categories, tBTA_SYS_ID sys_id);
|
||||
extern void bta_ar_reg_avrc(UINT16 service_uuid, char *p_service_name, char *p_provider_name,
|
||||
UINT16 categories, tBTA_SYS_ID sys_id, BOOLEAN browsing_en);
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
|
@ -556,6 +556,7 @@ typedef struct {
|
||||
UINT16 video_mtu; /* AVDTP video transport channel MTU at L2CAP */
|
||||
UINT16 video_flush_to; /* AVDTP video transport channel flush timeout */
|
||||
BOOLEAN avrc_group; /* TRUE, to accept AVRC 1.3 group nevigation command */
|
||||
BOOLEAN avrc_br; /* FALSE, does not support browsing channel */
|
||||
UINT8 num_co_ids; /* company id count in p_meta_co_ids */
|
||||
tBTA_AV_CODE rc_pass_rsp; /* the default response code for pass through commands */
|
||||
const UINT32 *p_meta_co_ids;/* the metadata Get Capabilities response for company id */
|
||||
|
@ -29,8 +29,8 @@
|
||||
|
||||
#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE)
|
||||
|
||||
#ifndef SDP_AVRCP_1_4
|
||||
#define SDP_AVRCP_1_4 TRUE
|
||||
#ifndef SDP_AVRCP_1_5
|
||||
#define SDP_AVRCP_1_5 TRUE
|
||||
#endif
|
||||
|
||||
#ifndef SDP_AVCTP_1_4
|
||||
@ -52,7 +52,7 @@ const tSDP_PROTOCOL_ELEM avrc_proto_list [] = {
|
||||
#if SDP_AVCTP_1_4 == TRUE
|
||||
{UUID_PROTOCOL_AVCTP, 1, {AVCT_REV_1_4, 0} }
|
||||
#else
|
||||
#if SDP_AVRCP_1_4 == TRUE
|
||||
#if (SDP_AVRCP_1_4 == TRUE || SDP_AVRCP_1_5 == TRUE)
|
||||
{UUID_PROTOCOL_AVCTP, 1, {AVCT_REV_1_3, 0} }
|
||||
#else
|
||||
#if AVRC_METADATA_INCLUDED == TRUE
|
||||
@ -64,13 +64,17 @@ const tSDP_PROTOCOL_ELEM avrc_proto_list [] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
#if SDP_AVRCP_1_4 == TRUE
|
||||
#if SDP_AVRCP_1_5 == TRUE
|
||||
const tSDP_PROTO_LIST_ELEM avrc_add_proto_list [] = {
|
||||
{
|
||||
AVRC_NUM_PROTO_ELEMS,
|
||||
{
|
||||
{UUID_PROTOCOL_L2CAP, 1, {AVCT_BR_PSM, 0} },
|
||||
#if SDP_AVCTP_1_4 == TRUE
|
||||
{UUID_PROTOCOL_AVCTP, 1, {AVCT_REV_1_4, 0} }
|
||||
#else
|
||||
{UUID_PROTOCOL_AVCTP, 1, {AVCT_REV_1_3, 0} }
|
||||
#endif
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -216,6 +220,8 @@ UINT16 AVRC_FindService(UINT16 service_uuid, BD_ADDR bd_addr,
|
||||
**
|
||||
** sdp_handle: SDP handle returned by SDP_CreateRecord().
|
||||
**
|
||||
** browsing_en: Supported browsing
|
||||
**
|
||||
** Output Parameters:
|
||||
** None.
|
||||
**
|
||||
@ -223,8 +229,8 @@ UINT16 AVRC_FindService(UINT16 service_uuid, BD_ADDR bd_addr,
|
||||
** AVRC_NO_RESOURCES if not enough resources to build the SDP record.
|
||||
**
|
||||
******************************************************************************/
|
||||
UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name,
|
||||
char *p_provider_name, UINT16 categories, UINT32 sdp_handle)
|
||||
UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name, char *p_provider_name,
|
||||
UINT16 categories, UINT32 sdp_handle, BOOLEAN browsing_en)
|
||||
{
|
||||
UINT16 browse_list[1];
|
||||
BOOLEAN result = TRUE;
|
||||
@ -232,9 +238,12 @@ UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name,
|
||||
UINT8 *p;
|
||||
UINT16 count = 1;
|
||||
UINT16 class_list[2];
|
||||
UINT16 supported_feature = categories;
|
||||
BOOLEAN media_player_virtual_filesystem_supported = FALSE;
|
||||
BOOLEAN add_additional_protocol_list = FALSE;
|
||||
|
||||
|
||||
AVRC_TRACE_API("AVRC_AddRecord uuid: %x", service_uuid);
|
||||
AVRC_TRACE_API("AVRC_AddRecord uuid: %x, browsing_en:%d", service_uuid, browsing_en);
|
||||
|
||||
if ( service_uuid != UUID_SERVCLASS_AV_REM_CTRL_TARGET && service_uuid != UUID_SERVCLASS_AV_REMOTE_CONTROL ) {
|
||||
return AVRC_BAD_PARAM;
|
||||
@ -242,18 +251,11 @@ UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name,
|
||||
|
||||
/* add service class id list */
|
||||
class_list[0] = service_uuid;
|
||||
#if SDP_AVCTP_1_4 == TRUE
|
||||
#if (SDP_AVCTP_1_4 == TRUE || SDP_AVRCP_1_5 == TRUE)
|
||||
if ( service_uuid == UUID_SERVCLASS_AV_REMOTE_CONTROL ) {
|
||||
class_list[1] = UUID_SERVCLASS_AV_REM_CTRL_CONTROL;
|
||||
count = 2;
|
||||
}
|
||||
#else
|
||||
#if SDP_AVRCP_1_4 == TRUE
|
||||
if ( service_uuid == UUID_SERVCLASS_AV_REMOTE_CONTROL ) {
|
||||
class_list[1] = UUID_SERVCLASS_AV_REM_CTRL_CONTROL;
|
||||
count = 2;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
result &= SDP_AddServiceClassIdList(sdp_handle, count, class_list);
|
||||
|
||||
@ -261,11 +263,21 @@ UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name,
|
||||
result &= SDP_AddProtocolList(sdp_handle, AVRC_NUM_PROTO_ELEMS, (tSDP_PROTOCOL_ELEM *)avrc_proto_list);
|
||||
|
||||
/* add profile descriptor list */
|
||||
#if SDP_AVRCP_1_4 == TRUE
|
||||
/* additional protocol list to include browsing channel */
|
||||
result &= SDP_AddAdditionProtoLists( sdp_handle, 1, (tSDP_PROTO_LIST_ELEM *)avrc_add_proto_list);
|
||||
#if SDP_AVRCP_1_5 == TRUE
|
||||
if (browsing_en) {
|
||||
add_additional_protocol_list = TRUE;
|
||||
} else if (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_TARGET &&
|
||||
(categories & (AVRC_SUPF_TG_CAT1 | AVRC_SUPF_TG_CAT3))) {
|
||||
AVRC_TRACE_WARNING("For AVRCP Target Cateory 1 and 3, SDP record shall contain additional protocol list");
|
||||
add_additional_protocol_list = TRUE;
|
||||
}
|
||||
|
||||
result &= SDP_AddProfileDescriptorList(sdp_handle, UUID_SERVCLASS_AV_REMOTE_CONTROL, AVRC_REV_1_4);
|
||||
if (add_additional_protocol_list) {
|
||||
/* additional protocol list to include browsing channel */
|
||||
result &= SDP_AddAdditionProtoLists( sdp_handle, 1, (tSDP_PROTO_LIST_ELEM *)avrc_add_proto_list);
|
||||
}
|
||||
|
||||
result &= SDP_AddProfileDescriptorList(sdp_handle, UUID_SERVCLASS_AV_REMOTE_CONTROL, AVRC_REV_1_5);
|
||||
#else
|
||||
#if AVRC_METADATA_INCLUDED == TRUE
|
||||
result &= SDP_AddProfileDescriptorList(sdp_handle, UUID_SERVCLASS_AV_REMOTE_CONTROL, AVRC_REV_1_3);
|
||||
@ -274,9 +286,15 @@ UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* add supported categories */
|
||||
/* Check if browsing is supported */
|
||||
if (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_CONTROL && browsing_en) {
|
||||
supported_feature |= AVRC_SUPF_CT_BROWSE;
|
||||
} else if (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_TARGET && media_player_virtual_filesystem_supported) {
|
||||
supported_feature |= AVRC_SUPF_TG_BROWSE;
|
||||
}
|
||||
/* add supported feature */
|
||||
p = temp;
|
||||
UINT16_TO_BE_STREAM(p, categories);
|
||||
UINT16_TO_BE_STREAM(p, supported_feature);
|
||||
result &= SDP_AddAttribute(sdp_handle, ATTR_ID_SUPPORTED_FEATURES, UINT_DESC_TYPE,
|
||||
(UINT32)2, (UINT8 *)temp);
|
||||
|
||||
|
@ -195,6 +195,8 @@ extern "C"
|
||||
**
|
||||
** sdp_handle: SDP handle returned by SDP_CreateRecord().
|
||||
**
|
||||
** browsing_en: Supported browsing
|
||||
**
|
||||
** Output Parameters:
|
||||
** None.
|
||||
**
|
||||
@ -202,8 +204,8 @@ extern "C"
|
||||
** AVRC_NO_RESOURCES if not enough resources to build the SDP record.
|
||||
**
|
||||
******************************************************************************/
|
||||
extern UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name,
|
||||
char *p_provider_name, UINT16 categories, UINT32 sdp_handle);
|
||||
extern UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name, char *p_provider_name,
|
||||
UINT16 categories, UINT32 sdp_handle, BOOLEAN browsing_en);
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
|
@ -34,6 +34,7 @@
|
||||
#define AVRC_REV_1_0 0x0100
|
||||
#define AVRC_REV_1_3 0x0103
|
||||
#define AVRC_REV_1_4 0x0104
|
||||
#define AVRC_REV_1_5 0x0105
|
||||
|
||||
#define AVRC_PACKET_LEN 512 /* Per the spec, you must support 512 byte RC packets */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user