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

Commit 4f820dbf authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Skip EATT connect for legacy devices" into main

parents 00008b43 2c2659e2
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -1533,10 +1533,21 @@ void btm_ble_link_encrypted(const RawAddress& bd_addr, uint8_t encr_enable) {
  }

  if (encr_enable) {
    /* Link is encrypted, start EATT */
    uint8_t remote_lmp_version = 0;
    if (!BTM_ReadRemoteVersion(p_dev_rec->ble.pseudo_addr, &remote_lmp_version,
                               nullptr, nullptr) ||
        remote_lmp_version == 0) {
      LOG_WARN("BLE Unable to determine remote version");
    }

    if (remote_lmp_version == 0 ||
        remote_lmp_version >= HCI_PROTO_VERSION_5_2) {
      /* Link is encrypted, start EATT if remote LMP version is unknown, or 5.2
       * or greater */
      bluetooth::eatt::EattExtension::GetInstance()->Connect(
          p_dev_rec->ble.pseudo_addr);
    }
  }

  /* to notify GATT to send data if any request is pending */
  gatt_notify_enc_cmpl(p_dev_rec->ble.pseudo_addr);
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#define HCI_PROTO_VERSION_4_1 0x07 /* Version for BT spec 4.1          */
#define HCI_PROTO_VERSION_4_2 0x08 /* Version for BT spec 4.2          */
#define HCI_PROTO_VERSION_5_0 0x09 /* Version for BT spec 5.0          */
#define HCI_PROTO_VERSION_5_2 0x0B /* Version for BT spec 5.2          */

/*
 *  Definitions for HCI groups