summaryrefslogtreecommitdiff
path: root/lib/bt/host/bluedroid/stack/avrc
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2025-07-25 13:33:07 +1000
committerjacqueline <me@jacqueline.id.au>2025-07-25 13:33:07 +1000
commitc8e79a926620e48830778714cfe4b2ea2453fcaf (patch)
tree8c756e08e01b8e147cf72bec128026f46bd854c5 /lib/bt/host/bluedroid/stack/avrc
parent237136f3e93cb6b5be24670d7520adb17cc0fa36 (diff)
downloadtangara-fw-c8e79a926620e48830778714cfe4b2ea2453fcaf.tar.gz
Update forked idf components
Diffstat (limited to 'lib/bt/host/bluedroid/stack/avrc')
-rw-r--r--lib/bt/host/bluedroid/stack/avrc/avrc_bld_ct.c24
-rw-r--r--lib/bt/host/bluedroid/stack/avrc/avrc_pars_ct.c13
-rw-r--r--lib/bt/host/bluedroid/stack/avrc/avrc_pars_tg.c2
-rw-r--r--lib/bt/host/bluedroid/stack/avrc/avrc_sdp.c23
4 files changed, 50 insertions, 12 deletions
diff --git a/lib/bt/host/bluedroid/stack/avrc/avrc_bld_ct.c b/lib/bt/host/bluedroid/stack/avrc/avrc_bld_ct.c
index 18106870..279313d4 100644
--- a/lib/bt/host/bluedroid/stack/avrc/avrc_bld_ct.c
+++ b/lib/bt/host/bluedroid/stack/avrc/avrc_bld_ct.c
@@ -50,7 +50,7 @@ static tAVRC_STS avrc_bld_next_cmd (tAVRC_NEXT_CMD *p_cmd, BT_HDR *p_pkt)
p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset;
p_data = p_start + 2; /* pdu + rsvd */
- /* add fixed lenth 1 - pdu_id (1) */
+ /* add fixed length 1 - pdu_id (1) */
UINT16_TO_BE_STREAM(p_data, 1);
UINT8_TO_BE_STREAM(p_data, p_cmd->target_pdu);
p_pkt->len = (p_data - p_start);
@@ -81,7 +81,7 @@ static tAVRC_STS avrc_bld_set_abs_volume_cmd (tAVRC_SET_VOLUME_CMD *p_cmd, BT_HD
/* get the existing length, if any, and also the num attributes */
p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset;
p_data = p_start + 2; /* pdu + rsvd */
- /* add fixed lenth 1 - volume (1) */
+ /* add fixed length 1 - volume (1) */
UINT16_TO_BE_STREAM(p_data, 1);
UINT8_TO_BE_STREAM(p_data, (AVRC_MAX_VOLUME & p_cmd->volume));
p_pkt->len = (p_data - p_start);
@@ -163,7 +163,7 @@ static BT_HDR *avrc_bld_init_cmd_buffer(tAVRC_COMMAND *p_cmd)
/* reserved 0, packet_type 0 */
UINT8_TO_BE_STREAM(p_data, 0);
/* continue to the next "case to add length */
- /* add fixed lenth - 0 */
+ /* add fixed length - 0 */
UINT16_TO_BE_STREAM(p_data, 0);
break;
}
@@ -237,6 +237,20 @@ static tAVRC_STS avrc_bld_get_element_attr_cmd (tAVRC_GET_ELEM_ATTRS_CMD *p_cmd,
return AVRC_STS_NO_ERROR;
}
+static tAVRC_STS avrc_bld_get_play_status_cmd(tAVRC_CMD *p_cmd, BT_HDR *p_pkt)
+{
+ UINT8 *p_data, *p_start;
+
+ AVRC_TRACE_API("avrc_bld_get_play_status");
+ /* get the existing length */
+ p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset;
+ p_data = p_start + 2; /* pdu + rsvd */
+ /* add parameter length 0 */
+ UINT16_TO_BE_STREAM(p_data, 0);
+ p_pkt->len = (p_data - p_start);
+ return AVRC_STS_NO_ERROR;
+}
+
static tAVRC_STS avrc_bld_get_caps_cmd(tAVRC_GET_CAPS_CMD *p_cmd, BT_HDR *p_pkt)
{
UINT8 *p_data, *p_start;
@@ -309,6 +323,10 @@ tAVRC_STS AVRC_BldCommand( tAVRC_COMMAND *p_cmd, BT_HDR **pp_pkt)
status = avrc_bld_get_element_attr_cmd(&p_cmd->get_elem_attrs, p_pkt);
break;
+ case AVRC_PDU_GET_PLAY_STATUS: /* 0x30 */
+ status = avrc_bld_get_play_status_cmd(&p_cmd->get_play_status, p_pkt);
+ break;
+
case AVRC_PDU_REGISTER_NOTIFICATION: /* 0x31 */
status = avrc_bld_register_change_notfn(p_cmd->reg_notif.event_id, p_cmd->reg_notif.param, p_pkt);
break;
diff --git a/lib/bt/host/bluedroid/stack/avrc/avrc_pars_ct.c b/lib/bt/host/bluedroid/stack/avrc/avrc_pars_ct.c
index f185e7b5..72f26513 100644
--- a/lib/bt/host/bluedroid/stack/avrc/avrc_pars_ct.c
+++ b/lib/bt/host/bluedroid/stack/avrc/avrc_pars_ct.c
@@ -113,6 +113,19 @@ static tAVRC_STS avrc_pars_vendor_rsp(tAVRC_MSG_VENDOR *p_msg, tAVRC_RESPONSE *p
}
}
break;
+ case AVRC_PDU_GET_PLAY_STATUS:
+ if (p_msg->hdr.ctype == AVRC_RSP_IMPL_STBL) {
+ BE_STREAM_TO_UINT32(p_result->get_play_status.song_len, p);
+ BE_STREAM_TO_UINT32(p_result->get_play_status.song_pos, p);
+ BE_STREAM_TO_UINT8(p_result->get_play_status.play_status, p);
+ }
+ else {
+ /* got error response */
+ p_result->get_play_status.song_len = 0;
+ p_result->get_play_status.song_pos = 0;
+ p_result->get_play_status.play_status = AVRC_PLAYSTATE_ERROR;
+ }
+ break;
default:
status = AVRC_STS_BAD_CMD;
break;
diff --git a/lib/bt/host/bluedroid/stack/avrc/avrc_pars_tg.c b/lib/bt/host/bluedroid/stack/avrc/avrc_pars_tg.c
index c30bf94a..fe04ca8f 100644
--- a/lib/bt/host/bluedroid/stack/avrc/avrc_pars_tg.c
+++ b/lib/bt/host/bluedroid/stack/avrc/avrc_pars_tg.c
@@ -71,7 +71,7 @@ static tAVRC_STS avrc_pars_vendor_cmd(tAVRC_MSG_VENDOR *p_msg, tAVRC_COMMAND *p_
p++; /* skip the reserved byte */
BE_STREAM_TO_UINT16 (len, p);
if ((len + 4) != (p_msg->vendor_len)) {
- status = AVRC_STS_INTERNAL_ERR;
+ status = AVRC_STS_NOT_FOUND;
}
if (status != AVRC_STS_NO_ERROR) {
diff --git a/lib/bt/host/bluedroid/stack/avrc/avrc_sdp.c b/lib/bt/host/bluedroid/stack/avrc/avrc_sdp.c
index fa98082e..0b624b3f 100644
--- a/lib/bt/host/bluedroid/stack/avrc/avrc_sdp.c
+++ b/lib/bt/host/bluedroid/stack/avrc/avrc_sdp.c
@@ -29,8 +29,8 @@
#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE)
-#ifndef SDP_AVRCP_1_5
-#define SDP_AVRCP_1_5 TRUE
+#ifndef SDP_AVRCP_1_6
+#define SDP_AVRCP_1_6 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 || SDP_AVRCP_1_5 == TRUE)
+#if SDP_AVRCP_1_6 == TRUE
{UUID_PROTOCOL_AVCTP, 1, {AVCT_REV_1_3, 0} }
#else
#if AVRC_METADATA_INCLUDED == TRUE
@@ -64,7 +64,7 @@ const tSDP_PROTOCOL_ELEM avrc_proto_list [] = {
#endif
};
-#if SDP_AVRCP_1_5 == TRUE
+#if SDP_AVRCP_1_6 == TRUE
const tSDP_PROTO_LIST_ELEM avrc_add_proto_list [] = {
{
AVRC_NUM_PROTO_ELEMS,
@@ -251,7 +251,7 @@ UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name, char *p_provide
/* add service class id list */
class_list[0] = service_uuid;
-#if (SDP_AVCTP_1_4 == TRUE || SDP_AVRCP_1_5 == TRUE)
+#if (SDP_AVCTP_1_4 == TRUE || SDP_AVRCP_1_6 == TRUE)
if ( service_uuid == UUID_SERVCLASS_AV_REMOTE_CONTROL ) {
class_list[1] = UUID_SERVCLASS_AV_REM_CTRL_CONTROL;
count = 2;
@@ -263,7 +263,7 @@ UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name, char *p_provide
result &= SDP_AddProtocolList(sdp_handle, AVRC_NUM_PROTO_ELEMS, (tSDP_PROTOCOL_ELEM *)avrc_proto_list);
/* add profile descriptor list */
-#if SDP_AVRCP_1_5 == TRUE
+#if SDP_AVRCP_1_6 == TRUE
if (browsing_en) {
add_additional_protocol_list = TRUE;
} else if (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_TARGET &&
@@ -277,7 +277,7 @@ UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name, char *p_provide
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);
+ result &= SDP_AddProfileDescriptorList(sdp_handle, UUID_SERVCLASS_AV_REMOTE_CONTROL, AVRC_REV_1_6);
#else
#if AVRC_METADATA_INCLUDED == TRUE
result &= SDP_AddProfileDescriptorList(sdp_handle, UUID_SERVCLASS_AV_REMOTE_CONTROL, AVRC_REV_1_3);
@@ -292,6 +292,13 @@ UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name, char *p_provide
} else if (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_TARGET && media_player_virtual_filesystem_supported) {
supported_feature |= AVRC_SUPF_TG_BROWSE;
}
+#if AVRC_CA_INCLUDED
+ if (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_CONTROL || service_uuid == UUID_SERVCLASS_AV_REMOTE_CONTROL) {
+ supported_feature |= AVRC_SUPF_CT_COVER_ART_GIP;
+ supported_feature |= AVRC_SUPF_CT_COVER_ART_GI;
+ supported_feature |= AVRC_SUPF_CT_COVER_ART_GLT;
+ }
+#endif
/* add supported feature */
p = temp;
UINT16_TO_BE_STREAM(p, supported_feature);
@@ -383,7 +390,7 @@ bt_status_t AVRC_Init(void)
**
** Function AVRC_Deinit
**
-** Description This function is called at stack shotdown to free the
+** Description This function is called at stack shutdown to free the
** control block (if using dynamic memory), and deinitializes the
** control block and tracing level.
**