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

Commit 7e8a1901 authored by Chris Manton's avatar Chris Manton
Browse files

Re-log stack/acl/btm_acl::lmp_version_below

Towards loggable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Test: act.py -tc BleCocTest
Change-Id: I7f8cc5a16178e0c1fc88bf31ba1207186bec6d48
parent e0fbb4de
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -2375,12 +2375,17 @@ void btm_acl_chk_peer_pkt_type_support(tACL_CONN* p, uint16_t* p_pkt_type) {
}

bool lmp_version_below(const RawAddress& bda, uint8_t version) {
  tACL_CONN* acl = internal_.btm_bda_to_acl(bda, BT_TRANSPORT_LE);
  if (acl == NULL || acl->lmp_version == 0) {
    LOG_WARN("Unable to find active acl");
  const tACL_CONN* acl = internal_.btm_bda_to_acl(bda, BT_TRANSPORT_LE);
  if (acl == nullptr) {
    LOG_INFO("Unable to get LMP version as no le acl exists to device");
    return false;
  }
  if (acl->lmp_version == 0) {
    LOG_INFO("Unable to get LMP version as value has not been set");
    return false;
  }
  LOG_DEBUG("LMP version %d < %d", acl->lmp_version, version);
  LOG_DEBUG("Requested LMP version:%hhu acl_version:%hhu", version,
            acl->lmp_version);
  return acl->lmp_version < version;
}