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

Commit ec2ab990 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Gerrit Code Review
Browse files

Merge changes I60b334ef,I390a385c,I0a562e1b

* changes:
  Revert "Remove unused API BTM_IsPhy2mSupported"
  Revert "Remove unused API BTM_RequestPeerSCA"
  Revert "Remove unused API BTM_GetPeerSCA"
parents 7898ae38 237ec343
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -66,6 +66,11 @@ bool BTM_IsBleConnection(uint16_t hci_handle) {
  mock_function_count_map[__func__]++;
  return false;
}
bool BTM_IsPhy2mSupported(const RawAddress& remote_bda,
                          tBT_TRANSPORT transport) {
  mock_function_count_map[__func__]++;
  return false;
}
bool BTM_ReadRemoteConnectionAddr(const RawAddress& pseudo_addr,
                                  RawAddress& conn_addr,
                                  tBLE_ADDR_TYPE* p_addr_type) {
@@ -215,6 +220,10 @@ tHCI_REASON btm_get_acl_disc_reason_code(void) {
  mock_function_count_map[__func__]++;
  return HCI_SUCCESS;
}
uint8_t BTM_GetPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport) {
  mock_function_count_map[__func__]++;
  return 0;
}
uint8_t BTM_SetTraceLevel(uint8_t new_level) {
  mock_function_count_map[__func__]++;
  return 0;
@@ -242,6 +251,9 @@ void BTM_ReadConnectionAddr(const RawAddress& remote_bda,
                            tBLE_ADDR_TYPE* p_addr_type) {
  mock_function_count_map[__func__]++;
}
void BTM_RequestPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport) {
  mock_function_count_map[__func__]++;
}
void BTM_acl_after_controller_started(const controller_t* controller) {
  mock_function_count_map[__func__]++;
}
+67 −0
Original line number Diff line number Diff line
@@ -1236,6 +1236,73 @@ uint16_t BTM_GetHCIConnHandle(const RawAddress& remote_bda,
  return HCI_INVALID_HANDLE;
}

/*******************************************************************************
 *
 * Function         BTM_IsPhy2mSupported
 *
 * Description      This function is called to check PHY 2M support
 *                  from peer device
 * Returns          True when PHY 2M supported false otherwise
 *
 ******************************************************************************/
bool BTM_IsPhy2mSupported(const RawAddress& remote_bda, tBT_TRANSPORT transport) {
  tACL_CONN* p;
  BTM_TRACE_DEBUG("BTM_IsPhy2mSupported");
  p = internal_.btm_bda_to_acl(remote_bda, transport);
  if (p == (tACL_CONN*)NULL) {
    BTM_TRACE_DEBUG("BTM_IsPhy2mSupported: no connection");
    return false;
  }

  if (!p->peer_le_features_valid) {
    LOG_WARN(
        "Checking remote features but remote feature read is "
        "incomplete");
  }
  return HCI_LE_2M_PHY_SUPPORTED(p->peer_le_features);
}

/*******************************************************************************
 *
 * Function         BTM_RequestPeerSCA
 *
 * Description      This function is called to request sleep clock accuracy
 *                  from peer device
 *
 ******************************************************************************/
void BTM_RequestPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport) {
  tACL_CONN* p;
  p = internal_.btm_bda_to_acl(remote_bda, transport);
  if (p == (tACL_CONN*)NULL) {
    LOG_WARN("Unable to find active acl");
    return;
  }

  btsnd_hcic_req_peer_sca(p->hci_handle);
}

/*******************************************************************************
 *
 * Function         BTM_GetPeerSCA
 *
 * Description      This function is called to get peer sleep clock accuracy
 *
 * Returns          SCA or 0xFF if SCA was never previously requested, request
 *                  is not supported by peer device or ACL does not exist
 *
 ******************************************************************************/
uint8_t BTM_GetPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport) {
  tACL_CONN* p;
  p = internal_.btm_bda_to_acl(remote_bda, transport);
  if (p != (tACL_CONN*)NULL) {
    return (p->sca);
  }
  LOG_WARN("Unable to find active acl");

  /* If here, no BD Addr found */
  return (0xFF);
}

/*******************************************************************************
 *
 * Function         btm_rejectlist_role_change_device
+35 −0
Original line number Diff line number Diff line
@@ -750,6 +750,41 @@ tBTM_STATUS BTM_SetSsrParams(const RawAddress& remote_bda, uint16_t max_lat,
uint16_t BTM_GetHCIConnHandle(const RawAddress& remote_bda,
                              tBT_TRANSPORT transport);

/*******************************************************************************
 *
 * Function         BTM_IsPhy2mSupported
 *
 * Description      This function is called to check PHY 2M support
 *                  from peer device
 * Returns          True when PHY 2M supported false otherwise
 *
 ******************************************************************************/
bool BTM_IsPhy2mSupported(const RawAddress& remote_bda, tBT_TRANSPORT transport);

/*******************************************************************************
 *
 * Function         BTM_RequestPeerSCA
 *
 * Description      This function is called to request sleep clock accuracy
 *                  from peer device
 *
 ******************************************************************************/
extern void BTM_RequestPeerSCA(const RawAddress& remote_bda,
                               tBT_TRANSPORT transport);

/*******************************************************************************
 *
 * Function         BTM_GetPeerSCA
 *
 * Description      This function is called to get peer sleep clock accuracy
 *
 * Returns          SCA or 0xFF if SCA was never previously requested, request
 *                  is not supported by peer device or ACL does not exist
 *
 ******************************************************************************/
extern uint8_t BTM_GetPeerSCA(const RawAddress& remote_bda,
                              tBT_TRANSPORT transport);

/*******************************************************************************
 *
 * Function         BTM_DeleteStoredLinkKey