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

Commit 8936ab93 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "GATT: Fix data length parameter" into sc-qpr1-dev am: 0af18518

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/15788530

Change-Id: I2c592a2619f33bef3d317e1e7d4c7c13caf2cf89
parents 0d16fc7b 0af18518
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -46,6 +46,8 @@
#define GATT_MTU_RSP_MIN_LEN 2
#define GATT_MTU_RSP_MIN_LEN 2
#define GATT_READ_BY_TYPE_RSP_MIN_LEN 1
#define GATT_READ_BY_TYPE_RSP_MIN_LEN 1


#define L2CAP_PKT_OVERHEAD 4

using base::StringPrintf;
using base::StringPrintf;
using bluetooth::Uuid;
using bluetooth::Uuid;
using bluetooth::eatt::EattExtension;
using bluetooth::eatt::EattExtension;
@@ -1094,7 +1096,7 @@ void gatt_process_mtu_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, uint16_t len,
      tcb.payload_size = mtu;
      tcb.payload_size = mtu;
  }
  }


  BTM_SetBleDataLength(tcb.peer_bda, tcb.payload_size);
  BTM_SetBleDataLength(tcb.peer_bda, tcb.payload_size + L2CAP_PKT_OVERHEAD);


  gatt_end_operation(p_clcb, status, NULL);
  gatt_end_operation(p_clcb, status, NULL);
}
}
+2 −1
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@
#include "stack/eatt/eatt.h"
#include "stack/eatt/eatt.h"
#include "stack/l2cap/l2c_int.h"
#include "stack/l2cap/l2c_int.h"
#define GATT_MTU_REQ_MIN_LEN 2
#define GATT_MTU_REQ_MIN_LEN 2
#define L2CAP_PKT_OVERHEAD 4


using base::StringPrintf;
using base::StringPrintf;
using bluetooth::Uuid;
using bluetooth::Uuid;
@@ -814,7 +815,7 @@ static void gatts_process_mtu_req(tGATT_TCB& tcb, uint16_t cid, uint16_t len,


  LOG(INFO) << "MTU request PDU with MTU size " << +tcb.payload_size;
  LOG(INFO) << "MTU request PDU with MTU size " << +tcb.payload_size;


  BTM_SetBleDataLength(tcb.peer_bda, tcb.payload_size);
  BTM_SetBleDataLength(tcb.peer_bda, tcb.payload_size + L2CAP_PKT_OVERHEAD);


  tGATT_SR_MSG gatt_sr_msg;
  tGATT_SR_MSG gatt_sr_msg;
  gatt_sr_msg.mtu = tcb.payload_size;
  gatt_sr_msg.mtu = tcb.payload_size;