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

Commit fd190c29 authored by Zach Johnson's avatar Zach Johnson
Browse files

Remove BTM_SP_KEYPRESS_EVT & associated code

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I3c5a78c4f4136dc81111ad7bf189f130a0fc411b
parent bc585280
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -2564,9 +2564,6 @@ static uint8_t bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) {
       * auth_complete_callback */
      break;

    case BTM_SP_KEYPRESS_EVT:
      break;

    default:
      status = BTM_NOT_AUTHORIZED;
      break;
+0 −16
Original line number Diff line number Diff line
@@ -1782,22 +1782,6 @@ void BTM_ConfirmReqReply(tBTM_STATUS res, const RawAddress& bd_addr);
void BTM_PasskeyReqReply(tBTM_STATUS res, const RawAddress& bd_addr,
                         uint32_t passkey);

/*******************************************************************************
 *
 * Function         BTM_SendKeypressNotif
 *
 * Description      This function is used during the passkey entry model
 *                  by a device with KeyboardOnly IO capabilities
 *                  (very likely to be a HID Device).
 *                  It is called by a HID Device to inform the remote device
 *                  when a key has been entered or erased.
 *
 * Parameters:      bd_addr - Address of the peer device
 *                  type - notification type
 *
 ******************************************************************************/
void BTM_SendKeypressNotif(const RawAddress& bd_addr, tBTM_SP_KEY_TYPE type);

/*******************************************************************************
 *
 * Function         BTM_IoCapRsp
+0 −12
Original line number Diff line number Diff line
@@ -3203,18 +3203,6 @@ void btm_proc_sp_req_evt(tBTM_SP_EVT event, uint8_t* p) {
 *
 ******************************************************************************/
void btm_keypress_notif_evt(uint8_t* p) {
  tBTM_SP_KEYPRESS evt_data;

  /* parse & report BTM_SP_KEYPRESS_EVT */
  if (btm_cb.api.p_sp_callback) {
    RawAddress& p_bda = evt_data.bd_addr;

    STREAM_TO_BDADDR(p_bda, p);
    evt_data.notif_type = *p;

    (*btm_cb.api.p_sp_callback)(BTM_SP_KEYPRESS_EVT,
                                (tBTM_SP_EVT_DATA*)&evt_data);
  }
}

/*******************************************************************************
+0 −18
Original line number Diff line number Diff line
@@ -869,7 +869,6 @@ enum {
  BTM_SP_CFM_REQ_EVT,   /* received USER_CONFIRMATION_REQUEST event */
  BTM_SP_KEY_NOTIF_EVT, /* received USER_PASSKEY_NOTIFY event */
  BTM_SP_KEY_REQ_EVT,   /* received USER_PASSKEY_REQUEST event */
  BTM_SP_KEYPRESS_EVT,  /* received KEYPRESS_NOTIFY event */
  BTM_SP_LOC_OOB_EVT,   /* received result for READ_LOCAL_OOB_DATA command */
  BTM_SP_RMT_OOB_EVT,   /* received REMOTE_OOB_DATA_REQUEST event */
  BTM_SP_COMPLT_EVT,    /* received SIMPLE_PAIRING_COMPLETE event */
@@ -968,22 +967,6 @@ typedef struct {
  uint32_t passkey;     /* passkey */
} tBTM_SP_KEY_NOTIF;

enum {
  BTM_SP_KEY_STARTED,     /* 0 - passkey entry started */
  BTM_SP_KEY_ENTERED,     /* 1 - passkey digit entered */
  BTM_SP_KEY_ERASED,      /* 2 - passkey digit erased */
  BTM_SP_KEY_CLEARED,     /* 3 - passkey cleared */
  BTM_SP_KEY_COMPLT,      /* 4 - passkey entry completed */
  BTM_SP_KEY_OUT_OF_RANGE /* 5 - out of range */
};
typedef uint8_t tBTM_SP_KEY_TYPE;

/* data type for BTM_SP_KEYPRESS_EVT */
typedef struct {
  RawAddress bd_addr; /* peer address */
  tBTM_SP_KEY_TYPE notif_type;
} tBTM_SP_KEYPRESS;

/* data type for BTM_SP_LOC_OOB_EVT */
typedef struct {
  tBTM_STATUS status; /* */
@@ -1012,7 +995,6 @@ typedef union {
  tBTM_SP_CFM_REQ cfm_req;     /* BTM_SP_CFM_REQ_EVT     */
  tBTM_SP_KEY_NOTIF key_notif; /* BTM_SP_KEY_NOTIF_EVT   */
  tBTM_SP_KEY_REQ key_req;     /* BTM_SP_KEY_REQ_EVT     */
  tBTM_SP_KEYPRESS key_press;  /* BTM_SP_KEYPRESS_EVT    */
  tBTM_SP_LOC_OOB loc_oob;     /* BTM_SP_LOC_OOB_EVT     */
  tBTM_SP_RMT_OOB rmt_oob;     /* BTM_SP_RMT_OOB_EVT     */
  tBTM_SP_COMPLT complt;       /* BTM_SP_COMPLT_EVT      */
+1 −1
Original line number Diff line number Diff line
@@ -758,7 +758,7 @@ void smp_process_keypress_notification(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  if (p != NULL) {
    STREAM_TO_UINT8(p_cb->peer_keypress_notification, p);
  } else {
    p_cb->peer_keypress_notification = BTM_SP_KEY_OUT_OF_RANGE;
    p_cb->peer_keypress_notification = SMP_SC_KEY_OUT_OF_RANGE;
  }
  p_cb->cb_evt = SMP_PEER_KEYPR_NOT_EVT;
}
Loading