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

Commit 77d0494d authored by Hansong Zhang's avatar Hansong Zhang
Browse files

AVRC uses the same mtu (part 2)

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ie7e5be1bd0b1c94aac122aedf3ee05dac45e386e
parent 85e058b5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -122,9 +122,9 @@ void bta_ar_avdt_conn(tBTA_SYS_ID sys_id, const RawAddress& bd_addr,
 * Returns          void
 *
 ******************************************************************************/
void bta_ar_reg_avct(uint16_t mtu, uint16_t mtu_br) {
void bta_ar_reg_avct(uint16_t mtu_br) {
  if (bta_ar_cb.avct_registered == 0) {
    AVCT_Register(mtu, mtu_br);
    AVCT_Register(mtu_br);
  }
  bta_ar_cb.avct_registered |= BTA_AR_AV_MASK;
}
+2 −2
Original line number Diff line number Diff line
@@ -472,7 +472,7 @@ static void bta_av_api_register(tBTA_AV_DATA* p_data) {
      if (bta_av_cb.features & (BTA_AV_FEAT_RCTG)) {
        /* register with no authorization; let AVDTP use authorization instead
         */
        bta_ar_reg_avct(kAvrcMtu, p_bta_av_cfg->avrc_br_mtu);
        bta_ar_reg_avct(p_bta_av_cfg->avrc_br_mtu);

        /* For the Audio Sink role we support additional TG to support
         * absolute volume.
@@ -619,7 +619,7 @@ static void bta_av_api_register(tBTA_AV_DATA* p_data) {
      if (bta_av_cb.features & (BTA_AV_FEAT_RCCT)) {
        /* if TG is not supported, we need to register to AVCT now */
        if ((bta_av_cb.features & (BTA_AV_FEAT_RCTG)) == 0) {
          bta_ar_reg_avct(kAvrcMtu, p_bta_av_cfg->avrc_br_mtu);
          bta_ar_reg_avct(p_bta_av_cfg->avrc_br_mtu);
          bta_av_rc_create(&bta_av_cb, AVCT_ACP, 0, BTA_AV_NUM_LINKS + 1);
        }
        /* create an SDP record as AVRC CT. We create 1.3 for SOURCE
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ extern void bta_ar_avdt_conn(tBTA_SYS_ID sys_id, const RawAddress& bd_addr,
 * Returns          void
 *
 ******************************************************************************/
extern void bta_ar_reg_avct(uint16_t mtu, uint16_t mtu_br);
extern void bta_ar_reg_avct(uint16_t mtu_br);

/*******************************************************************************
 *
+0 −2
Original line number Diff line number Diff line
@@ -373,8 +373,6 @@ struct tBTA_AV_SCB;
union tBTA_AV_DATA;
typedef void (*tBTA_AV_ACT)(tBTA_AV_SCB* p_cb, tBTA_AV_DATA* p_data);

constexpr uint16_t kAvrcMtu = 512; /* AVRCP MTU at L2CAP for control channel */

/* AV configuration structure */
typedef struct {
  uint32_t company_id;  /* AVRCP Company ID */
+2 −6
Original line number Diff line number Diff line
@@ -53,19 +53,15 @@ tAVCT_CB avct_cb;
 * Returns          void
 *
 ******************************************************************************/
void AVCT_Register(uint16_t mtu, UNUSED_ATTR uint16_t mtu_br) {
void AVCT_Register(uint16_t mtu_br) {
  AVCT_TRACE_API("AVCT_Register");

  /* initialize AVCTP data structures */
  memset(&avct_cb, 0, sizeof(tAVCT_CB));

  if (mtu < AVCT_MIN_CONTROL_MTU) mtu = AVCT_MIN_CONTROL_MTU;
  /* store mtu */
  avct_cb.mtu = mtu;

  /* register PSM with L2CAP */
  L2CA_Register2(AVCT_PSM, avct_l2c_appl, true /* enable_snoop */, nullptr,
                 avct_cb.mtu, BTA_SEC_AUTHENTICATE);
                 kAvrcMtu, BTA_SEC_AUTHENTICATE);

  /* Include the browsing channel which uses eFCR */
  tL2CAP_ERTM_INFO ertm_info;
Loading