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

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

Properly type stack/smp::tSMP_EVT

Bug: 163134718
Test: cert
Tag: #refactor

Change-Id: I9a8cc028eaf994b9b8b94d62ddaae05f4cb038e8
parent 82e0debb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ typedef enum : uint8_t {
} tSMP_OPCODE;

/* SMP event type */
#define SMP_EVT_NONE 0           /* Default no event */
#define SMP_IO_CAP_REQ_EVT 1     /* IO capability request event */
#define SMP_SEC_REQUEST_EVT 2    /* SMP pairing request */
#define SMP_PASSKEY_NOTIF_EVT 3  /* passkey notification event */
+5 −1
Original line number Diff line number Diff line
@@ -132,6 +132,7 @@ void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
        break;

      default:
        LOG_ERROR("Unexpected event:%hhu", p_cb->cb_evt);
        break;
    }

@@ -218,6 +219,9 @@ void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {

          smp_br_state_machine_event(p_cb, SMP_BR_KEYS_RSP_EVT, NULL);
          break;

        default:
          LOG_ERROR("Unexpected event: %hhu", p_cb->cb_evt);
      }
    }
  }
@@ -429,7 +433,7 @@ void smp_proc_sec_req(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {

  SMP_TRACE_DEBUG("%s: auth_req=0x%x", __func__, auth_req);

  p_cb->cb_evt = 0;
  p_cb->cb_evt = SMP_EVT_NONE;

  btm_ble_link_sec_check(p_cb->pairing_bda, auth_req, &sec_req_act);

+2 −2
Original line number Diff line number Diff line
@@ -316,7 +316,7 @@ void SMP_SecurityGrant(const RawAddress& bd_addr, uint8_t res) {

    /* clear the SMP_SEC_REQUEST_EVT event after get grant */
    /* avoid generating duplicate pair request */
    smp_cb.cb_evt = 0;
    smp_cb.cb_evt = SMP_EVT_NONE;
    tSMP_INT_DATA smp_int_data;
    smp_int_data.status = res;
    smp_br_state_machine_event(&smp_cb, SMP_BR_API_SEC_GRANT_EVT,
@@ -329,7 +329,7 @@ void SMP_SecurityGrant(const RawAddress& bd_addr, uint8_t res) {
    return;
  /* clear the SMP_SEC_REQUEST_EVT event after get grant */
  /* avoid generate duplicate pair request */
  smp_cb.cb_evt = 0;
  smp_cb.cb_evt = SMP_EVT_NONE;
  tSMP_INT_DATA smp_int_data;
  smp_int_data.status = res;
  smp_sm_event(&smp_cb, SMP_API_SEC_GRANT_EVT, &smp_int_data);
+1 −1
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ typedef struct {
  uint8_t status;
  uint8_t role;
  uint16_t flags;
  uint8_t cb_evt;
  tSMP_EVT cb_evt;
  tSMP_SEC_LEVEL sec_level;
  bool connect_initialized;
  Octet16 confirm;