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

Commit 62cca5ac authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Gerrit Code Review
Browse files

Merge "Make local ATT MTU configurable"

parents 0432d8db a6fd438c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2056,7 +2056,7 @@ class LeAudioClientImpl : public LeAudioClient {
    if (leAudioDevice->mtu_ == GATT_DEF_BLE_MTU_SIZE) {
    if (leAudioDevice->mtu_ == GATT_DEF_BLE_MTU_SIZE) {
      LOG(INFO) << __func__ << ", Configure MTU";
      LOG(INFO) << __func__ << ", Configure MTU";
      /* Use here kBapMinimumAttMtu, because we know that GATT will request
      /* Use here kBapMinimumAttMtu, because we know that GATT will request
       * GATT_MAX_MTU_SIZE on ATT anyways. We also know that GATT will use this
       * default ATT MTU anyways. We also know that GATT will use this
       * kBapMinimumAttMtu as an input for Data Length Update procedure in the controller.
       * kBapMinimumAttMtu as an input for Data Length Update procedure in the controller.
       */
       */
      BtaGattQueue::ConfigureMtu(leAudioDevice->conn_id_, kBapMinimumAttMtu);
      BtaGattQueue::ConfigureMtu(leAudioDevice->conn_id_, kBapMinimumAttMtu);
+1 −0
Original line number Original line Diff line number Diff line
@@ -403,6 +403,7 @@ init_flags!(
        use_unified_connection_manager,
        use_unified_connection_manager,
        sdp_return_classic_services_when_le_discovery_fails = true,
        sdp_return_classic_services_when_le_discovery_fails = true,
        use_rsi_from_cached_inqiry_results = false,
        use_rsi_from_cached_inqiry_results = false,
        att_mtu_default: i32 = 517,
    }
    }
    // dynamic flags can be updated at runtime and should be accessed directly
    // dynamic flags can be updated at runtime and should be accessed directly
    // to check.
    // to check.
+1 −0
Original line number Original line Diff line number Diff line
@@ -57,6 +57,7 @@ mod ffi {
        fn use_unified_connection_manager_is_enabled() -> bool;
        fn use_unified_connection_manager_is_enabled() -> bool;
        fn sdp_return_classic_services_when_le_discovery_fails_is_enabled() -> bool;
        fn sdp_return_classic_services_when_le_discovery_fails_is_enabled() -> bool;
        fn use_rsi_from_cached_inqiry_results_is_enabled() -> bool;
        fn use_rsi_from_cached_inqiry_results_is_enabled() -> bool;
        fn get_att_mtu_default() -> i32;
    }
    }
}
}


+2 −2
Original line number Original line Diff line number Diff line
@@ -723,8 +723,8 @@ tGATT_STATUS GATTC_ConfigureMTU(uint16_t conn_id, uint16_t mtu) {


  /* Since GATT MTU Exchange can be done only once, and it is impossible to
  /* Since GATT MTU Exchange can be done only once, and it is impossible to
   * predict what MTU will be requested by other applications, let's use
   * predict what MTU will be requested by other applications, let's use
   * max possible MTU in the request. */
   * default MTU in the request. */
  gatt_cl_msg.mtu = GATT_MAX_MTU_SIZE;
  gatt_cl_msg.mtu = gatt_get_local_mtu();


  LOG_INFO("Configuring ATT mtu size conn_id:%hu mtu:%hu user mtu %hu", conn_id,
  LOG_INFO("Configuring ATT mtu size conn_id:%hu mtu:%hu user mtu %hu", conn_id,
           gatt_cl_msg.mtu, mtu);
           gatt_cl_msg.mtu, mtu);
+2 −2
Original line number Original line Diff line number Diff line
@@ -1103,11 +1103,11 @@ void gatt_process_mtu_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, uint16_t len,
             tcb.pending_user_mtu_exchange_value,
             tcb.pending_user_mtu_exchange_value,
             tcb.peer_bda.ToString().c_str(), mtu);
             tcb.peer_bda.ToString().c_str(), mtu);


    /* Aim for MAX as we did in the request */
    /* Aim for default as we did in the request */
    if (mtu < GATT_DEF_BLE_MTU_SIZE) {
    if (mtu < GATT_DEF_BLE_MTU_SIZE) {
      tcb.payload_size = GATT_DEF_BLE_MTU_SIZE;
      tcb.payload_size = GATT_DEF_BLE_MTU_SIZE;
    } else {
    } else {
      tcb.payload_size = std::min(mtu, (uint16_t)(GATT_MAX_MTU_SIZE));
      tcb.payload_size = std::min(mtu, (uint16_t)(gatt_get_local_mtu()));
    }
    }


    bluetooth::shim::arbiter::GetArbiter().OnIncomingMtuResp(tcb.tcb_idx,
    bluetooth::shim::arbiter::GetArbiter().OnIncomingMtuResp(tcb.tcb_idx,
Loading