Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebbb2251 authored by Anubhav Gupta's avatar Anubhav Gupta Committed by Sanket Agarwal
Browse files

Support for A2DP Sink and Proper initialization of profiles

 - Register SDP and SEP (Stream End Point) for the profile
   whose init is called. We achieve this by making registration
   api aware of profile id being called.
 - Register A2DP Src + Avrcp Target + Avrcp Controller. We need
   to support Absolute Volume as well, so Avrcp Controller is
   required here.
 - Register A2DP Sink + Avrcp Controller. In this case we do not
   support absolute volume. Support would be added in AVRCP
   controller change
 - Adapter property is updated with profile ID for which init is
   called.This is required to make changes in btService for Profile
   initialization
 - Start listening for incoming AVRCP connection if we have
   only AVRCP Controller
 - Update default peer_features based on feature mask. In case
   of incoming AVRCP connection, SDP will be done later.
   In such a scenario default peer features sent to btif should
   be based on  features-set selected during initialization.
 - Drop Control, Meta and Browse commands when TG is not up.
 - Not to call AVRCP app callbacks when mentioned service is down.
 - Close audio socket on suspend

A2DP Sink: Support for AudioTrack

 - implemetation for audiotrack to take care of audio rendering
 - support for audio focus state in bluedroid

Bluetooth: Support for Avrcp 1.3  Controller

- support for SDP registration
- support for sending vendor dependant commands
- support for abs vol
- support for receiving vendor dependant response
- serialization of connection and rc_features callback

Avrcp_Ctrl: handling of commands and events for AVRCP Controller

- support of parsing cmd and event pdus
- timeout handling

Change-Id: I1e8d49b087eff6301373e1e90e8d868f15847c34
parent d5895a3c
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -243,7 +243,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 browse_supported)
{
    UINT8   mask = bta_ar_id (sys_id);
    UINT8   temp[8], *p;
@@ -257,20 +257,23 @@ void bta_ar_reg_avrc(UINT16 service_uuid, char *service_name, char *provider_nam
        {
            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, browse_supported);
            bta_sys_add_uuid(service_uuid);
        }
        /* only one TG is allowed (first-come, first-served).
         * If sdp_tg_handle is non-0, ignore this request */
    }
    else if ((service_uuid == UUID_SERVCLASS_AV_REMOTE_CONTROL) || (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_CONTROL))
    else if ((service_uuid == UUID_SERVCLASS_AV_REMOTE_CONTROL)||
             (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_CONTROL))
    {
        bta_ar_cb.ct_categories [mask - 1] = categories;
        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, browse_supported);
            bta_sys_add_uuid(service_uuid);
        }
        else
+12 −5
Original line number Diff line number Diff line
@@ -1311,9 +1311,13 @@ void bta_av_setconfig_rsp (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
    APPL_TRACE_DEBUG("bta_av_setconfig_rsp: sep_idx: %d cur_psc_mask:0x%x", p_scb->sep_idx, p_scb->cur_psc_mask);

    if ((AVDT_TSEP_SNK == local_sep) && (p_data->ci_setconfig.err_code == AVDT_SUCCESS) &&
                                     (p_scb->seps[p_scb->sep_idx].p_app_data_cback != NULL))
                                     (p_scb->seps[p_scb->sep_idx].p_app_data_cback != NULL)) {
        tBTA_AV_MEDIA av_sink_codec_info;
        memcpy(av_sink_codec_info.avk_config.bd_addr,p_scb->peer_addr,sizeof(BD_ADDR));
        av_sink_codec_info.avk_config.codec_info = p_scb->cfg.codec_info;
        p_scb->seps[p_scb->sep_idx].p_app_data_cback(BTA_AV_MEDIA_SINK_CFG_EVT,
                                              (tBTA_AV_MEDIA*)p_scb->cfg.codec_info);
                                              &av_sink_codec_info);
    }


    AVDT_ConfigRsp(p_scb->avdt_handle, p_scb->avdt_label, p_data->ci_setconfig.err_code,
@@ -1918,9 +1922,12 @@ void bta_av_getcap_results (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
        if ((uuid_int == UUID_SERVCLASS_AUDIO_SINK) &&
            (p_scb->seps[p_scb->sep_idx].p_app_data_cback != NULL))
        {
            APPL_TRACE_DEBUG(" Configure Deoder for Sink Connection ");
            APPL_TRACE_DEBUG("%s Configure Decoder for Sink Connection.", __func__);
            tBTA_AV_MEDIA av_sink_codec_info;
            memcpy(av_sink_codec_info.avk_config.bd_addr,p_scb->peer_addr,sizeof(BD_ADDR));
            av_sink_codec_info.avk_config.codec_info = p_scb->cfg.codec_info;
            p_scb->seps[p_scb->sep_idx].p_app_data_cback(BTA_AV_MEDIA_SINK_CFG_EVT,
                     (tBTA_AV_MEDIA*)p_scb->cfg.codec_info);
                                                         &av_sink_codec_info);
        }

        /* open the stream */
+225 −83
Original line number Diff line number Diff line
@@ -45,6 +45,10 @@

#include "osi/include/log.h"

#if (AVRC_CTLR_INCLUDED == TRUE)
#include <cutils/properties.h>
#endif

/*****************************************************************************
**  Constants
*****************************************************************************/
@@ -571,8 +575,12 @@ void bta_av_rc_opened(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
    if (rc_open.peer_features == 0)
    {
        /* we have not done SDP on peer RC capabilities.
         * peer must have initiated the RC connection */
        rc_open.peer_features = BTA_AV_FEAT_RCCT;
         * peer must have initiated the RC connection
         * We Don't have SDP records of Peer, so we by
         * default will take values depending upon registered
         * features */
        if (p_cb->features & BTA_AV_FEAT_RCTG)
            rc_open.peer_features |= BTA_AV_FEAT_RCCT;
        bta_av_rc_disc(disc);
    }
    (*p_cb->p_cback)(BTA_AV_RC_OPEN_EVT, (tBTA_AV *) &rc_open);
@@ -868,7 +876,9 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
    tBTA_AV     av;
    BT_HDR      *p_pkt = NULL;
    tAVRC_MSG_VENDOR    *p_vendor = &p_data->rc_msg.msg.vendor;
    BOOLEAN is_inquiry = ((p_data->rc_msg.msg.hdr.ctype == AVRC_CMD_SPEC_INQ) || p_data->rc_msg.msg.hdr.ctype == AVRC_CMD_GEN_INQ);
    BOOLEAN is_inquiry =
        ((p_data->rc_msg.msg.hdr.ctype == AVRC_CMD_SPEC_INQ) ||
         p_data->rc_msg.msg.hdr.ctype == AVRC_CMD_GEN_INQ);
#if (AVRC_METADATA_INCLUDED == TRUE)
    UINT8       ctype = 0;
    tAVRC_RESPONSE  rc_rsp;
@@ -885,6 +895,8 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
            )
        {
            /* check if operation is supported */
            char avrcp_ct_support[PROPERTY_VALUE_MAX];
            property_get("bluetooth.pts.avrcp_ct.support", avrcp_ct_support, "false");
            if (p_data->rc_msg.msg.pass.op_id == AVRC_ID_VENDOR)
            {
                p_data->rc_msg.msg.hdr.ctype = BTA_AV_RSP_NOT_IMPL;
@@ -895,9 +907,18 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
                        p_data->rc_msg.msg.pass.p_pass_data, is_inquiry);
#endif
            }
#if (AVRC_CTLR_INCLUDED == TRUE)
            else if (((p_data->rc_msg.msg.pass.op_id == AVRC_ID_VOL_UP)||
                      (p_data->rc_msg.msg.pass.op_id == AVRC_ID_VOL_DOWN)) &&
                     !strcmp(avrcp_ct_support, "true"))
            {
                p_data->rc_msg.msg.hdr.ctype = BTA_AV_RSP_ACCEPT;
            }
#endif
            else
            {
                p_data->rc_msg.msg.hdr.ctype = bta_av_op_supported(p_data->rc_msg.msg.pass.op_id, is_inquiry);
                p_data->rc_msg.msg.hdr.ctype =
                    bta_av_op_supported(p_data->rc_msg.msg.pass.op_id, is_inquiry);
            }

            APPL_TRACE_DEBUG("ctype %d",p_data->rc_msg.msg.hdr.ctype)
@@ -919,7 +940,8 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
            }
        }
        /* else if this is a pass thru response */
        else if (p_data->rc_msg.msg.hdr.ctype >= AVRC_RSP_ACCEPT)
        /* id response type is not impl, we have to release label */
        else if (p_data->rc_msg.msg.hdr.ctype >= AVRC_RSP_NOT_IMPL)
        {
            /* set up for callback */
            evt = BTA_AV_REMOTE_RSP_EVT;
@@ -927,6 +949,19 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
            av.remote_rsp.key_state = p_data->rc_msg.msg.pass.state;
            av.remote_rsp.rsp_code = p_data->rc_msg.msg.hdr.ctype;
            av.remote_rsp.label = p_data->rc_msg.label;

            /* If this response is for vendor unique command  */
            if ((p_data->rc_msg.msg.pass.op_id == AVRC_ID_VENDOR) &&
              (p_data->rc_msg.msg.pass.pass_len > 0))
            {
                av.remote_rsp.p_data = (UINT8*)osi_getbuf(p_data->rc_msg.msg.pass.pass_len);
                if (av.remote_rsp.p_data != NULL)
                {
                    APPL_TRACE_DEBUG("Vendor Unique data len = %d",p_data->rc_msg.msg.pass.pass_len);
                    memcpy(av.remote_rsp.p_data,p_data->rc_msg.msg.pass.p_pass_data,
                                             p_data->rc_msg.msg.pass.pass_len);
                }
            }
        }
        /* must be a bad ctype -> reject*/
        else
@@ -962,7 +997,7 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
        }
        /* else if configured to support vendor specific and it's a response */
        else if ((p_cb->features & BTA_AV_FEAT_VENDOR) &&
                 p_data->rc_msg.msg.hdr.ctype >= AVRC_RSP_ACCEPT)
                 p_data->rc_msg.msg.hdr.ctype >= AVRC_RSP_NOT_IMPL)
        {
#if (AVRC_METADATA_INCLUDED == TRUE)
            if ((p_cb->features & BTA_AV_FEAT_METADATA) &&
@@ -1664,7 +1699,8 @@ tBTA_AV_FEAT bta_av_check_peer_features (UINT16 service_uuid)
        if (( SDP_FindAttributeInRec(p_rec, ATTR_ID_BT_PROFILE_DESC_LIST)) != NULL)
        {
            /* get profile version (if failure, version parameter is not updated) */
            SDP_FindProfileVersionInRec(p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version);
            SDP_FindProfileVersionInRec(p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL,
                                                                &peer_rc_version);
            APPL_TRACE_DEBUG("peer_rc_version 0x%x", peer_rc_version);

            if (peer_rc_version >= AVRC_REV_1_3)
@@ -1688,6 +1724,80 @@ tBTA_AV_FEAT bta_av_check_peer_features (UINT16 service_uuid)
    return peer_features;
}

/*******************************************************************************
**
** Function         bta_avk_check_peer_features
**
** Description      check supported features on the peer device from the SDP record
**                  and return the feature mask
**
** Returns          tBTA_AV_FEAT peer device feature mask
**
*******************************************************************************/
tBTA_AV_FEAT bta_avk_check_peer_features (UINT16 service_uuid)
{
    tBTA_AV_FEAT peer_features = 0;
    tBTA_AV_CB *p_cb = &bta_av_cb;

    APPL_TRACE_DEBUG("%s service_uuid:x%x", __FUNCTION__, service_uuid);

    /* loop through all records we found */
    tSDP_DISC_REC *p_rec = SDP_FindServiceInDb(p_cb->p_disc_db, service_uuid, NULL);
    while (p_rec)
    {
        APPL_TRACE_DEBUG("%s found Service record for x%x", __FUNCTION__, service_uuid);

        if (( SDP_FindAttributeInRec(p_rec, ATTR_ID_SERVICE_CLASS_ID_LIST)) != NULL)
        {
            /* find peer features */
            if (SDP_FindServiceInDb(p_cb->p_disc_db, UUID_SERVCLASS_AV_REMOTE_CONTROL, NULL))
            {
                peer_features |= BTA_AV_FEAT_RCCT;
            }
            if (SDP_FindServiceInDb(p_cb->p_disc_db, UUID_SERVCLASS_AV_REM_CTRL_TARGET, NULL))
            {
                peer_features |= BTA_AV_FEAT_RCTG;
            }
        }

        if (( SDP_FindAttributeInRec(p_rec, ATTR_ID_BT_PROFILE_DESC_LIST)) != NULL)
        {
            /* get profile version (if failure, version parameter is not updated) */
            UINT16 peer_rc_version = 0;
            BOOLEAN val = SDP_FindProfileVersionInRec(
                p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version);
            APPL_TRACE_DEBUG("%s peer_rc_version for TG 0x%x, profile_found %d",
                             __FUNCTION__, peer_rc_version, val);

            if (peer_rc_version >= AVRC_REV_1_3)
                peer_features |= (BTA_AV_FEAT_VENDOR | BTA_AV_FEAT_METADATA);

            /*
             * Though Absolute Volume came after in 1.4 and above, but there are few devices
             * in market which supports absolute Volume and they are still 1.3
             * TO avoid IOT issuses with those devices, we check for 1.3 as minimum version
             */
            if (peer_rc_version >= AVRC_REV_1_3)
            {
                /* get supported categories */
                tSDP_DISC_ATTR *p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_SUPPORTED_FEATURES);
                if (p_attr != NULL)
                {
                    UINT16 categories = p_attr->attr_value.v.u16;
                    if (categories & AVRC_SUPF_CT_CAT2)
                        peer_features |= (BTA_AV_FEAT_ADV_CTRL);
                    if (categories & AVRC_SUPF_CT_APP_SETTINGS)
                        peer_features |= (BTA_AV_FEAT_APP_SETTING);
                }
            }
        }
        /* get next record; if none found, we're done */
        p_rec = SDP_FindServiceInDb(p_cb->p_disc_db, service_uuid, p_rec);
    }
    APPL_TRACE_DEBUG("%s peer_features:x%x", __FUNCTION__, peer_features);
    return peer_features;
}

/*******************************************************************************
**
** Function         bta_av_rc_disc_done
@@ -1706,10 +1816,10 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
    tBTA_AV_RC_OPEN rc_open;
    tBTA_AV_RC_FEAT rc_feat;
    UINT8               rc_handle;
    tBTA_AV_FEAT        peer_features;  /* peer features mask */
    tBTA_AV_FEAT        peer_features = 0;  /* peer features mask */
    UNUSED(p_data);

    APPL_TRACE_DEBUG("bta_av_rc_disc_done disc:x%x", p_cb->disc);
    APPL_TRACE_DEBUG("%s bta_av_rc_disc_done disc:x%x", __FUNCTION__, p_cb->disc);
    if (!p_cb->disc)
    {
        return;
@@ -1728,7 +1838,9 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
            p_scb = p_cb->p_scb[(p_cb->disc & BTA_AV_HNDL_MSK) - 1];
        }
        if (p_scb)
        {
            rc_handle = p_scb->rc_handle;
        }
        else
        {
            p_cb->disc = 0;
@@ -1736,15 +1848,26 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
        }
    }

    APPL_TRACE_DEBUG("rc_handle %d", rc_handle);
    APPL_TRACE_DEBUG("%s rc_handle %d", __FUNCTION__, rc_handle);
    if (p_cb->sdp_a2d_snk_handle)
    {
        /* This is Sink + CT + TG(Abs Vol) */
        peer_features = bta_avk_check_peer_features(UUID_SERVCLASS_AV_REM_CTRL_TARGET);
        if (BTA_AV_FEAT_ADV_CTRL & bta_avk_check_peer_features(UUID_SERVCLASS_AV_REMOTE_CONTROL))
            peer_features |= (BTA_AV_FEAT_ADV_CTRL|BTA_AV_FEAT_RCCT);
    }
    else if (p_cb->sdp_a2d_handle)
    {
        /* check peer version and whether support CT and TG role */
        peer_features = bta_av_check_peer_features(UUID_SERVCLASS_AV_REMOTE_CONTROL);
    if ((p_cb->features & BTA_AV_FEAT_ADV_CTRL) && ((peer_features&BTA_AV_FEAT_ADV_CTRL) == 0))
        if ((p_cb->features & BTA_AV_FEAT_ADV_CTRL) &&
            ((peer_features & BTA_AV_FEAT_ADV_CTRL) == 0))
        {
            /* if we support advance control and peer does not, check their support on TG role
             * some implementation uses 1.3 on CT ans 1.4 on TG */
            peer_features |= bta_av_check_peer_features(UUID_SERVCLASS_AV_REM_CTRL_TARGET);
        }
    }

    p_cb->disc = 0;
    utl_freebuf((void **) &p_cb->p_disc_db);
@@ -1789,6 +1912,17 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
        p_cb->rcb[rc_handle].peer_features = peer_features;
        rc_feat.rc_handle =  rc_handle;
        rc_feat.peer_features = peer_features;
        if (p_scb == NULL)
        {
            /*
             * In case scb is not created by the time we are done with SDP
             * we still need to send RC feature event. So we need to get BD
             * from Message
             */
            bdcpy(rc_feat.peer_addr, p_cb->lcb[p_cb->rcb[rc_handle].lidx].addr);
        }
        else
            bdcpy(rc_feat.peer_addr, p_scb->peer_addr);
        (*p_cb->p_cback)(BTA_AV_RC_FEAT_EVT, (tBTA_AV *) &rc_feat);
    }
}
@@ -2014,12 +2148,20 @@ void bta_av_dereg_comp(tBTA_AV_DATA *p_data)
#if ( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
                bta_ar_dereg_avrc (UUID_SERVCLASS_AV_REMOTE_CONTROL, BTA_ID_AV);
#endif
                if (p_cb->sdp_a2d_handle)
                {
                    bta_av_del_sdp_rec(&p_cb->sdp_a2d_handle);
                    p_cb->sdp_a2d_handle = 0;
                    bta_sys_remove_uuid(UUID_SERVCLASS_AUDIO_SOURCE);
                }

#if (BTA_AV_SINK_INCLUDED == TRUE)
                if (p_cb->sdp_a2d_snk_handle)
                {
                    bta_av_del_sdp_rec(&p_cb->sdp_a2d_snk_handle);
                    p_cb->sdp_a2d_snk_handle = 0;
                    bta_sys_remove_uuid(UUID_SERVCLASS_AUDIO_SINK);
                }
#endif
            }
        }
+34 −2
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@
 *
 ******************************************************************************/

#include <assert.h>

#include "bt_target.h"
#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE)

@@ -110,7 +112,8 @@ void BTA_AvDisable(void)
** Returns          void
**
*******************************************************************************/
void BTA_AvRegister(tBTA_AV_CHNL chnl, const char *p_service_name, UINT8 app_id, tBTA_AV_DATA_CBACK  *p_data_cback)
void BTA_AvRegister(tBTA_AV_CHNL chnl, const char *p_service_name, UINT8 app_id,
                    tBTA_AV_DATA_CBACK  *p_data_cback, UINT16 service_uuid)
{
    tBTA_AV_API_REG  *p_buf;

@@ -121,7 +124,9 @@ void BTA_AvRegister(tBTA_AV_CHNL chnl, const char *p_service_name, UINT8 app_id,
        p_buf->hdr.event = BTA_AV_API_REGISTER_EVT;
        if(p_service_name)
        {
            BCM_STRNCPY_S(p_buf->p_service_name, sizeof(p_buf->p_service_name), p_service_name, BTA_SERVICE_NAME_LEN);
            BCM_STRNCPY_S(
                p_buf->p_service_name, sizeof(p_buf->p_service_name), p_service_name,
                BTA_SERVICE_NAME_LEN);
            p_buf->p_service_name[BTA_SERVICE_NAME_LEN-1] = 0;
        }
        else
@@ -130,6 +135,7 @@ void BTA_AvRegister(tBTA_AV_CHNL chnl, const char *p_service_name, UINT8 app_id,
        }
        p_buf->app_id = app_id;
        p_buf->p_app_data_cback = p_data_cback;
        p_buf->service_uuid = service_uuid;
        bta_sys_sendmsg(p_buf);
    }
}
@@ -461,6 +467,32 @@ void BTA_AvRemoteCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_RC rc_id, tBTA_AV_STA
    }
}

/*******************************************************************************
**
** Function         BTA_AvRemoteVendorUniqueCmd
**
** Description      Send a remote control command with Vendor Unique rc_id. This function can only
**                  be used if AV is enabled with feature BTA_AV_FEAT_RCCT.
**
** Returns          void
**
*******************************************************************************/
void BTA_AvRemoteVendorUniqueCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_STATE key_state,
                                 UINT8* p_msg, UINT8 buf_len)
{
    tBTA_AV_API_REMOTE_CMD  *p_buf =
        (tBTA_AV_API_REMOTE_CMD *) osi_getbuf(sizeof(tBTA_AV_API_REMOTE_CMD));
    assert(p_buf);
    p_buf->hdr.event = BTA_AV_API_REMOTE_CMD_EVT;
    p_buf->hdr.layer_specific   = rc_handle;
    p_buf->msg.op_id = AVRC_ID_VENDOR;
    p_buf->msg.state = key_state;
    p_buf->msg.p_pass_data = p_msg;
    p_buf->msg.pass_len = buf_len;
    p_buf->label = label;
    bta_sys_sendmsg(p_buf);
}

/*******************************************************************************
**
** Function         BTA_AvVendorCmd
+51 −1
Original line number Diff line number Diff line
@@ -40,7 +40,16 @@ const UINT32 bta_av_meta_caps_co_ids[] = {
};

/* AVRCP cupported categories */
#if (AVRC_CTLR_INCLUDED == TRUE)
#define BTA_AV_RC_SUPF_CT       (AVRC_SUPF_CT_CAT1 | AVRC_SUPF_CT_CAT2)
#else
#define BTA_AV_RC_SUPF_CT       (AVRC_SUPF_CT_CAT2)
#endif

#if (AVRC_CTLR_INCLUDED == TRUE)
#define BTA_AVK_RC_SUPF_CT       (AVRC_SUPF_CT_CAT1)
#define BTA_AVK_RC_SUPF_TG       (AVRC_SUPF_TG_CAT2)
#endif

/* Added to modify
**	1. flush timeout
@@ -81,11 +90,22 @@ const UINT8 bta_av_meta_caps_evt_ids[] = {
#define BTA_AV_NUM_RC_EVT_IDS   (sizeof(bta_av_meta_caps_evt_ids) / sizeof(bta_av_meta_caps_evt_ids[0]))
#endif /* BTA_AV_NUM_RC_EVT_IDS */

const UINT8  bta_avk_meta_caps_evt_ids[] = {
#if AVRC_ADV_CTRL_INCLUDED == TRUE
    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 */


/* the MTU for the AVRCP browsing channel */
#ifndef BTA_AV_MAX_RC_BR_MTU
#define BTA_AV_MAX_RC_BR_MTU      1008
#endif

/* This configuration to be used when we are Src + TG + CT( only for abs vol) */
const tBTA_AV_CFG bta_av_cfg =
{
    AVRC_CO_BROADCOM,       /* AVRCP Company ID */
@@ -115,7 +135,37 @@ const tBTA_AV_CFG bta_av_cfg =
    {0},                    /* Default AVRCP target name */
};

tBTA_AV_CFG *p_bta_av_cfg = (tBTA_AV_CFG *) &bta_av_cfg;
/* This configuration to be used when we are Sink + CT + TG( only for abs vol) */
const tBTA_AV_CFG bta_avk_cfg =
{
    AVRC_CO_METADATA,       /* AVRCP Company ID */
#if AVRC_METADATA_INCLUDED == TRUE
    512,                    /* AVRCP MTU at L2CAP for control channel */
#else
    48,                     /* AVRCP MTU at L2CAP for control channel */
#endif
    BTA_AV_MAX_RC_BR_MTU,   /* AVRCP MTU at L2CAP for browsing channel */
    BTA_AVK_RC_SUPF_CT,      /* AVRCP controller categories */
    BTA_AVK_RC_SUPF_TG,      /* AVRCP target categories */
    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_AVK_NUM_RC_EVT_IDS, /* event id count in p_meta_evt_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 */
    bta_avk_meta_caps_evt_ids,/* the the metadata Get Capabilities response for event id */
    NULL,                   /* the action function table for VDP stream */
    NULL,                   /* action function to register VDP */
    {0},                    /* Default AVRCP controller name */
    {0},                    /* Default AVRCP target name */
};

tBTA_AV_CFG *p_bta_av_cfg = NULL;

const UINT16 bta_av_rc_id[] =
{
Loading