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

Commit 57a097ca authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Get rid of BTM_IS_PUBLIC_BDA

One can't really guess address type based on last bits.
Instead, for new devices always assume public address.

Test: scan, toggle bluetooth, try connecting to device with public
      address
Bug: 74413120

Change-Id: Id558260798e717c214a5a817cea0c204c5f4858e
(cherry-picked from 8c2e78b44727789d641492beeef873b230c7e568)
parent 3360f04e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -209,11 +209,9 @@ bool btm_add_dev_to_controller(bool to_add, const RawAddress& bd_addr) {
  } else {
    /* not a known device, i.e. attempt to connect to device never seen before
     */
    uint8_t addr_type =
        BTM_IS_PUBLIC_BDA(bd_addr) ? BLE_ADDR_PUBLIC : BLE_ADDR_RANDOM;
    started = true;
    if (to_add)
      background_connection_add(addr_type, bd_addr);
      background_connection_add(BLE_ADDR_PUBLIC, bd_addr);
    else
      background_connection_remove(bd_addr);
  }
+0 −7
Original line number Diff line number Diff line
@@ -85,13 +85,6 @@ inline bool BTM_BLE_IS_RESOLVE_BDA(const RawAddress& x) {
  return ((x.address)[0] & BLE_RESOLVE_ADDR_MASK) == BLE_RESOLVE_ADDR_MSB;
}

#define BLE_PUBLIC_ADDR_MSB_MASK 0xC0
/*  most significant bit, bit7, bit6 is 10 to be public address*/
#define BLE_PUBLIC_ADDR_MSB 0x80
inline bool BTM_IS_PUBLIC_BDA(const RawAddress& x) {
  return ((x.address)[0] & BLE_PUBLIC_ADDR_MSB_MASK) == BLE_PUBLIC_ADDR_MSB;
}

/* LE scan activity bit mask, continue with LE inquiry bits */
/* observe is in progress */
#define BTM_LE_OBSERVE_ACTIVE 0x80