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

Commit b2f46147 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

SMP: Remove never used API

Test: compilation
Change-Id: I81fa57a5a8a48105a52c8cd387d89f38988f7cfc
parent 928a531e
Loading
Loading
Loading
Loading
+0 −28
Original line number Diff line number Diff line
@@ -174,34 +174,6 @@ extern void SMP_OobDataReply(const RawAddress& bd_addr, tSMP_STATUS res,
 ******************************************************************************/
extern void SMP_SecureConnectionOobDataReply(uint8_t* p_data);

/*******************************************************************************
 *
 * Function         SMP_KeypressNotification
 *
 * Description      Notify SM about Keypress Notification.
 *
 * Parameters:      bd_addr      - Address of the device to send keypress
 *                                 notification to
 *                  value        - keypress notification parameter value
 *
 ******************************************************************************/
extern void SMP_KeypressNotification(const RawAddress& bd_addr, uint8_t value);

/*******************************************************************************
 *
 * Function         SMP_CreateLocalSecureConnectionsOobData
 *
 * Description      This function is called to start creation of local SC OOB
 *                  data set (tSMP_LOC_OOB_DATA).
 *
 * Parameters:      bd_addr      - Address of the device to send OOB data block
 *                                 to.
 *
 *  Returns         Boolean - true: creation of local SC OOB data set started.
 ******************************************************************************/
extern bool SMP_CreateLocalSecureConnectionsOobData(
    tBLE_BD_ADDR* addr_to_send_to);

// Called when LTK request is received from controller.
extern bool smp_proc_ltk_request(const RawAddress& bda);

+0 −83
Original line number Diff line number Diff line
@@ -483,86 +483,3 @@ void SMP_SecureConnectionOobDataReply(uint8_t* p_data) {
  smp_int_data.p_data = p_data;
  smp_sm_event(&smp_cb, SMP_SC_OOB_DATA_EVT, &smp_int_data);
}

/*******************************************************************************
 *
 * Function         SMP_KeypressNotification
 *
 * Description      This function is called to notify Security Manager about
 *                  Keypress Notification.
 *
 * Parameters:     bd_addr      Address of the device to send keypress
 *                              notification to
 *                 value        Keypress notification parameter value
 *
 ******************************************************************************/
void SMP_KeypressNotification(const RawAddress& bd_addr, uint8_t value) {
  tSMP_CB* p_cb = &smp_cb;

  SMP_TRACE_EVENT("%s: Value: %d", __func__, value);

  if (bd_addr != p_cb->pairing_bda) {
    SMP_TRACE_ERROR("%s() - Wrong BD Addr", __func__);
    return;
  }

  if (btm_find_dev(bd_addr) == NULL) {
    SMP_TRACE_ERROR("%s() - no dev CB", __func__);
    return;
  }

  /* Keypress Notification is used by a device with KeyboardOnly IO capabilities
   * during the passkey entry protocol */
  if (p_cb->local_io_capability != SMP_IO_CAP_IN) {
    SMP_TRACE_ERROR("%s() - wrong local IO capabilities %d", __func__,
                    p_cb->local_io_capability);
    return;
  }

  if (p_cb->selected_association_model != SMP_MODEL_SEC_CONN_PASSKEY_ENT) {
    SMP_TRACE_ERROR("%s() - wrong protocol %d", __func__,
                    p_cb->selected_association_model);
    return;
  }

  tSMP_INT_DATA smp_int_data;
  smp_int_data.status = value;
  smp_sm_event(p_cb, SMP_KEYPRESS_NOTIFICATION_EVENT, &smp_int_data);
}

/*******************************************************************************
 *
 * Function         SMP_CreateLocalSecureConnectionsOobData
 *
 * Description      This function is called to start creation of local SC OOB
 *                  data set (tSMP_LOC_OOB_DATA).
 *
 * Parameters:      bd_addr - Address of the device to send OOB data block to
 *
 *  Returns         Boolean - true: creation of local SC OOB data set started.
 ******************************************************************************/
bool SMP_CreateLocalSecureConnectionsOobData(tBLE_BD_ADDR* addr_to_send_to) {
  tSMP_CB* p_cb = &smp_cb;

  if (addr_to_send_to == NULL) {
    SMP_TRACE_ERROR("%s addr_to_send_to is not provided", __func__);
    return false;
  }

  VLOG(2) << __func__ << " addr type:" << +addr_to_send_to->type
          << ", BDA:" << addr_to_send_to->bda << ", state:" << p_cb->state
          << ", br_state: " << p_cb->br_state;

  if ((p_cb->state != SMP_STATE_IDLE) || (p_cb->smp_over_br)) {
    SMP_TRACE_WARNING(
        "%s creation of local OOB data set "
        "starts only in IDLE state",
        __func__);
    return false;
  }

  p_cb->sc_oob_data.loc_oob_data.addr_sent_to = *addr_to_send_to;
  smp_sm_event(p_cb, SMP_CR_LOC_SC_OOB_DATA_EVT, NULL);

  return true;
}