#endif
/*
- * If the number of event IDs is changed in this array, BTA_AV_ NUM_RC_EVT_IDS
+ * If the number of event IDs is changed in this array, BTA_AV_NUM_RC_EVT_IDS
* also needs to be changed.
*/
const uint8_t bta_av_meta_caps_evt_ids[] = {
AVRC_EVT_APP_SETTING_CHANGE,
*/
};
+
#ifndef BTA_AV_NUM_RC_EVT_IDS
#define BTA_AV_NUM_RC_EVT_IDS \
(sizeof(bta_av_meta_caps_evt_ids) / sizeof(bta_av_meta_caps_evt_ids[0]))
AVRC_EVT_VOLUME_CHANGE,
#endif
};
+
#ifndef BTA_AVK_NUM_RC_EVT_IDS
#define BTA_AVK_NUM_RC_EVT_IDS \
(sizeof(bta_avk_meta_caps_evt_ids) / sizeof(bta_avk_meta_caps_evt_ids[0]))
#endif /* BTA_AVK_NUM_RC_EVT_IDS */
+// These are the only events used with AVRCP1.3
+const uint8_t bta_av_meta_caps_evt_ids_avrcp13[] = {
+ AVRC_EVT_PLAY_STATUS_CHANGE, AVRC_EVT_TRACK_CHANGE,
+ AVRC_EVT_PLAY_POS_CHANGED,
+};
+
+#ifndef BTA_AV_NUM_RC_EVT_IDS_AVRCP13
+#define BTA_AV_NUM_RC_EVT_IDS_AVRCP13 \
+ (sizeof(bta_av_meta_caps_evt_ids_avrcp13) / \
+ sizeof(bta_av_meta_caps_evt_ids_avrcp13[0]))
+#endif /* BTA_AVK_NUM_RC_EVT_IDS_AVRCP13 */
+
/* the MTU for the AVRCP browsing channel */
#ifndef BTA_AV_MAX_RC_BR_MTU
#define BTA_AV_MAX_RC_BR_MTU 1008
{0}, /* Default AVRCP target name */
};
+/* This configuration to be used when we are using AVRCP1.3 */
+const tBTA_AV_CFG bta_av_cfg_compatibility = {
+ BTA_AV_RC_COMP_ID, /* AVRCP Company ID */
+#if (AVRC_METADATA_INCLUDED == TRUE)
+ 512, /* AVRCP MTU at L2CAP for control channel */
+ BTA_AV_MAX_RC_BR_MTU, /* AVRCP MTU at L2CAP for browsing channel */
+#else
+ 48, /* AVRCP MTU at L2CAP for control channel */
+ BTA_AV_MAX_RC_BR_MTU, /* AVRCP MTU at L2CAP for browsing channel */
+#endif
+ BTA_AV_RC_SUPF_CT, /* AVRCP controller categories */
+ AVRC_SUPF_TG_CAT1, /* Only support CAT1 for AVRCP1.3 */
+ 672, /* AVDTP signaling channel MTU at L2CAP */
+ BTA_AV_MAX_A2DP_MTU, /* AVDTP audio transport channel MTU at L2CAP
+ */
+ bta_av_audio_flush_to, /* AVDTP audio transport channel flush
+ timeout */
+ 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 */
+ 2, /* company id count in p_meta_co_ids */
+ BTA_AV_NUM_RC_EVT_IDS_AVRCP13, /* event id count for AVRCP1.3*/
+ 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 */
+ bta_av_meta_caps_evt_ids_avrcp13, /* the the metadata Get Capabilities
+ response for event id, compatible
+ with AVRCP1.3*/
+ NULL, /* the action function table for VDP stream */
+ NULL, /* action function to register VDP */
+ BTA_AV_RC_CT_NAME, /* Default AVRCP controller name */
+ BTA_AV_RC_TG_NAME /* Default AVRCP target name */
+};
+
tBTA_AV_CFG* p_bta_av_cfg = NULL;
const uint16_t bta_av_rc_id[] = {
#define AVRCP_1_4_STRING "avrcp14"
#endif
+#ifndef AVRCP_1_3_STRING
+#define AVRCP_1_3_STRING "avrcp13"
+#endif
+
/* state machine states */
enum { BTA_AV_INIT_ST, BTA_AV_OPEN_ST };
registr.app_id = p_data->api_reg.app_id;
registr.chnl = (tBTA_AV_CHNL)p_data->hdr.layer_specific;
+ char avrcp_version[PROPERTY_VALUE_MAX] = {0};
+ osi_property_get(AVRCP_VERSION_PROPERTY, avrcp_version, AVRCP_1_4_STRING);
+ LOG_INFO(LOG_TAG, "AVRCP version used for sdp: \"%s\"", avrcp_version);
+
uint16_t profile_initialized = p_data->api_reg.service_uuid;
if (profile_initialized == UUID_SERVCLASS_AUDIO_SINK) {
p_bta_av_cfg = (tBTA_AV_CFG*)&bta_avk_cfg;
} else if (profile_initialized == UUID_SERVCLASS_AUDIO_SOURCE) {
p_bta_av_cfg = (tBTA_AV_CFG*)&bta_av_cfg;
+
+ if (!strncmp(AVRCP_1_3_STRING, avrcp_version, sizeof(AVRCP_1_3_STRING))) {
+ LOG_INFO(LOG_TAG, "AVRCP 1.3 capabilites used");
+ p_bta_av_cfg = (tBTA_AV_CFG*)&bta_av_cfg_compatibility;
+ }
}
APPL_TRACE_DEBUG("%s: profile: 0x%x", __func__, profile_initialized);
uint16_t profile_version = AVRC_REV_1_0;
if (profile_initialized == UUID_SERVCLASS_AUDIO_SOURCE) {
- // This check can override the AVRCP profile version with a property
- char avrcp_version[PROPERTY_VALUE_MAX] = {0};
- osi_property_get(AVRCP_VERSION_PROPERTY, avrcp_version,
- AVRCP_1_4_STRING);
- LOG_INFO(LOG_TAG, "AVRCP version used for sdp: \"%s\"",
- avrcp_version);
-
if (!strncmp(AVRCP_1_6_STRING, avrcp_version,
sizeof(AVRCP_1_6_STRING))) {
profile_version = AVRC_REV_1_6;
} else if (!strncmp(AVRCP_1_5_STRING, avrcp_version,
sizeof(AVRCP_1_5_STRING))) {
profile_version = AVRC_REV_1_5;
+ } else if (!strncmp(AVRCP_1_3_STRING, avrcp_version,
+ sizeof(AVRCP_1_3_STRING))) {
+ profile_version = AVRC_REV_1_3;
} else {
profile_version = AVRC_REV_1_4;
}