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

Commit dfcb428b authored by Chris Manton's avatar Chris Manton
Browse files

Add API stack/acl/btm_acl::BTM_IsAclConnectionUpAndHandleValid

Working towards encapsulation of tACL_CONN

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Id6fcd65a066eb3b2f458e378dd85467a96131561
parent ae69274a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1234,6 +1234,15 @@ bool BTM_IsAclConnectionUp(const RawAddress& remote_bda,
  return (false);
}

bool BTM_IsAclConnectionUpAndHandleValid(const RawAddress& remote_bda,
                                         tBT_TRANSPORT transport) {
  tACL_CONN* p_acl = btm_bda_to_acl(remote_bda, transport);
  if (p_acl == nullptr) {
    return false;
  }
  return p_acl->hci_handle != HCI_INVALID_HANDLE;
}

/*******************************************************************************
 *
 * Function         BTM_GetNumAclLinks
+5 −1
Original line number Diff line number Diff line
@@ -81,7 +81,8 @@ tBTM_STATUS BTM_GetLinkSuperTout(const RawAddress& remote_bda,
 * Function         BTM_IsAclConnectionUp
 *
 * Description      This function is called to check if an ACL connection exists
 *                  to a specific remote BD Address.
 *                  to a specific remote BD Address.  The second version ensures
 *                  the hci handle is valid (Unsure if needed)
 *
 * Returns          true if connection is up, else false.
 *
@@ -89,6 +90,9 @@ tBTM_STATUS BTM_GetLinkSuperTout(const RawAddress& remote_bda,
bool BTM_IsAclConnectionUp(const RawAddress& remote_bda,
                           tBT_TRANSPORT transport);

bool BTM_IsAclConnectionUpAndHandleValid(const RawAddress& remote_bda,
                                         tBT_TRANSPORT transport);

/*******************************************************************************
 *
 * Function         BTM_GetRole