|
|
@@ -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 ( 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 (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;
|
|
|
}
|
|
|
-#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);
|
|
|
|