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

Commit 5f28ef34 authored by Chris Manton's avatar Chris Manton
Browse files

Move BTM_IsBleConnection from btm to acl

Working towards encapsulation of tACL_CONN

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I8b8cc6a7e03fdc5f0b99afbc7a3486777630b4e9
parent 78fd96c9
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -2468,3 +2468,25 @@ bool acl_peer_supports_ble_connection_parameters_request(
  }
  return HCI_LE_CONN_PARAM_REQ_SUPPORTED(p_acl->peer_le_features);
}

/*******************************************************************************
 *
 * Function         BTM_IsBleConnection
 *
 * Description      This function is called to check if the connection handle
 *                  for an LE link
 *
 * Returns          true if connection is LE link, otherwise false.
 *
 ******************************************************************************/
bool BTM_IsBleConnection(uint16_t hci_handle) {
  if (bluetooth::shim::is_gd_shim_enabled()) {
    ASSERT_LOG(false, "This should not be invoked from code path");
  }

  uint8_t index = btm_handle_to_acl_index(hci_handle);
  if (index >= MAX_L2CAP_LINKS) return false;

  tACL_CONN* p = &btm_cb.acl_cb_.acl_db[index];
  return (p->transport == BT_TRANSPORT_LE);
}
+0 −27
Original line number Diff line number Diff line
@@ -259,33 +259,6 @@ void BTM_ReadConnectionAddr(const RawAddress& remote_bda,
                  p_acl->conn_addr_type, p_acl->conn_addr.address[0]);
}

/*******************************************************************************
 *
 * Function         BTM_IsBleConnection
 *
 * Description      This function is called to check if the connection handle
 *                  for an LE link
 *
 * Returns          true if connection is LE link, otherwise false.
 *
 ******************************************************************************/
bool BTM_IsBleConnection(uint16_t conn_handle) {
  if (bluetooth::shim::is_gd_shim_enabled()) {
    ASSERT_LOG(false, "This should not be invoked from code path");
  }
  uint8_t xx;
  tACL_CONN* p;

  BTM_TRACE_API("BTM_IsBleConnection: conn_handle: %d", conn_handle);

  xx = btm_handle_to_acl_index(conn_handle);
  if (xx >= MAX_L2CAP_LINKS) return false;

  p = &btm_cb.acl_cb_.acl_db[xx];

  return (p->transport == BT_TRANSPORT_LE);
}

/*******************************************************************************
 *
 * Function       BTM_ReadRemoteConnectionAddr
+25 −0
Original line number Diff line number Diff line
@@ -242,3 +242,28 @@ void btm_establish_continue_from_address(const RawAddress& remote_bda,

bool acl_peer_supports_ble_connection_parameters_request(
    const RawAddress& remote_bda);

/*******************************************************************************
 *
 * Function         BTM_ReadConnectionAddr
 *
 * Description      Read the local device random address.
 *
 * Returns          void
 *
 ******************************************************************************/
void BTM_ReadConnectionAddr(const RawAddress& remote_bda,
                            RawAddress& local_conn_addr,
                            tBLE_ADDR_TYPE* p_addr_type);

/*******************************************************************************
 *
 * Function         BTM_IsBleConnection
 *
 * Description      This function is called to check if the connection handle
 *                  for an LE link
 *
 * Returns          true if connection is LE link, otherwise false.
 *
 ******************************************************************************/
bool BTM_IsBleConnection(uint16_t hci_handle);