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

Commit 45ebba69 authored by Chris Manton's avatar Chris Manton
Browse files

Add stack/acl/btm_acl APIs

acl_address_from_handle(uint16_t hci_handle);
acl_power_mode_from_handle(uint16_t hci_handle);

Working towards encapsulation of tACL_CONN

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Id0847f16ee181a72bdc7032cf13706cdbc29e6ec
parent 23a6f8a0
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -2520,3 +2520,19 @@ bool BTM_IsBleConnection(uint16_t hci_handle) {
  tACL_CONN* p = &btm_cb.acl_cb_.acl_db[index];
  return (p->transport == BT_TRANSPORT_LE);
}

const RawAddress acl_address_from_handle(uint16_t hci_handle) {
  uint8_t index = btm_handle_to_acl_index(hci_handle);
  if (index >= MAX_L2CAP_LINKS) {
    return RawAddress::kEmpty;
  }
  return btm_cb.acl_cb_.acl_db[index].remote_addr;
}

tBTM_PM_MCB* acl_power_mode_from_handle(uint16_t hci_handle) {
  uint8_t index = btm_handle_to_acl_index(hci_handle);
  if (index >= MAX_L2CAP_LINKS) {
    return nullptr;
  }
  return &btm_cb.pm_mode_db[index];
}
+3 −0
Original line number Diff line number Diff line
@@ -267,3 +267,6 @@ void BTM_ReadConnectionAddr(const RawAddress& remote_bda,
 *
 ******************************************************************************/
bool BTM_IsBleConnection(uint16_t hci_handle);

const RawAddress acl_address_from_handle(uint16_t hci_handle);
tBTM_PM_MCB* acl_power_mode_from_handle(uint16_t hci_handle);