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

Commit 2f6a894d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add stack/acl/btm_acl::acl_ble_is_role_master"

parents 2d52d8be 4f7b2387
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ static tACL_CONN* acl_get_connection_from_handle(uint16_t handle);
static tACL_CONN* btm_bda_to_acl(const RawAddress& bda,
                                 tBT_TRANSPORT transport);
static tBTM_STATUS btm_set_packet_types(tACL_CONN* p, uint16_t pkt_types);
static bool acl_is_role_master(const RawAddress& bda, tBT_TRANSPORT transport);

void BTIF_dm_report_inquiry_status_change(uint8_t busy_level_flags);
void BTA_dm_acl_up(const RawAddress bd_addr, tBT_TRANSPORT transport,
@@ -2459,7 +2460,7 @@ bool lmp_version_below(const RawAddress& bda, uint8_t version) {
  return acl->lmp_version < version;
}

bool acl_br_edr_is_role_master(const RawAddress& bda) {
bool acl_is_role_master(const RawAddress& bda, tBT_TRANSPORT transport) {
  tACL_CONN* p = btm_bda_to_acl(bda, BT_TRANSPORT_BR_EDR);
  if (p == nullptr) {
    return false;
@@ -2467,6 +2468,14 @@ bool acl_br_edr_is_role_master(const RawAddress& bda) {
  return (p->link_role == HCI_ROLE_MASTER);
}

bool acl_br_edr_is_role_master(const RawAddress& bda) {
  return acl_is_role_master(bda, BT_TRANSPORT_BR_EDR);
}

bool acl_ble_is_role_master(const RawAddress& bda) {
  return acl_is_role_master(bda, BT_TRANSPORT_LE);
}

bool BTM_BLE_IS_RESOLVE_BDA(const RawAddress& x) {
  return ((x.address)[0] & BLE_RESOLVE_ADDR_MASK) == BLE_RESOLVE_ADDR_MSB;
}
+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ tGATT_STATUS gatts_db_read_attr_value_by_type(
        (type.As16Bit() == GATT_UUID_GAP_DEVICE_NAME)) {
      if ((flag & (BTM_SEC_LINK_KEY_KNOWN | BTM_SEC_FLAG_ENCRYPTED)) ==
          BTM_SEC_LINK_KEY_KNOWN) {
        if (acl_is_role_master(tcb.peer_bda, BT_TRANSPORT_LE)) {
        if (acl_ble_is_role_master(tcb.peer_bda)) {
          btm_ble_set_encryption(tcb.peer_bda, BTM_BLE_SEC_ENCRYPT,
                                 HCI_ROLE_MASTER);
        }
+1 −0
Original line number Diff line number Diff line
@@ -231,6 +231,7 @@ void btm_set_packet_types_from_address(const RawAddress& bda,
bool lmp_version_below(const RawAddress& bda, uint8_t version);

bool acl_br_edr_is_role_master(const RawAddress& bda);
bool acl_ble_is_role_master(const RawAddress& bda);

#define BLE_RESOLVE_ADDR_MASK 0xc0
#define BLE_RESOLVE_ADDR_MSB 0x40