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

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

Enum-ify tSMP_EVT

Toward readable code

Bug: 163134718
Test: gd/cert/run
Tag: #refactor

Change-Id: I12e2d8d7d1f8ddb05a6b9b673c74013fda5a0d22
parent 597095f0
Loading
Loading
Loading
Loading
+21 −18
Original line number Diff line number Diff line
@@ -44,24 +44,27 @@ 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 */
#define SMP_PASSKEY_REQ_EVT 4    /* passkey request event */
#define SMP_OOB_REQ_EVT 5        /* OOB request event */
#define SMP_NC_REQ_EVT 6         /* Numeric Comparison request event */
#define SMP_COMPLT_EVT 7         /* SMP complete event */
#define SMP_PEER_KEYPR_NOT_EVT 8 /* Peer keypress notification */
typedef enum : uint8_t {
  SMP_EVT_NONE = 0,           /* Default no event */
  SMP_IO_CAP_REQ_EVT = 1,     /* IO capability request event */
  SMP_SEC_REQUEST_EVT = 2,    /* SMP pairing request */
  SMP_PASSKEY_NOTIF_EVT = 3,  /* passkey notification event */
  SMP_PASSKEY_REQ_EVT = 4,    /* passkey request event */
  SMP_OOB_REQ_EVT = 5,        /* OOB request event */
  SMP_NC_REQ_EVT = 6,         /* Numeric Comparison request event */
  SMP_COMPLT_EVT = 7,         /* SMP complete event */
  SMP_PEER_KEYPR_NOT_EVT = 8, /* Peer keypress notification */

  /* SC OOB request event (both local and peer OOB data can be expected in
   * response) */
#define SMP_SC_OOB_REQ_EVT 9
  SMP_SC_OOB_REQ_EVT = 9,
  /* SC OOB local data set is created (as result of SMP_CrLocScOobData(...)) */
#define SMP_SC_LOC_OOB_DATA_UP_EVT 10
#define SMP_BR_KEYS_REQ_EVT 12 /* SMP over BR keys request event */
#define SMP_CONSENT_REQ_EVT 14 /* Consent request event */
typedef uint8_t tSMP_EVT;
  SMP_SC_LOC_OOB_DATA_UP_EVT = 10,
  SMP_UNUSED11 = 11,
  SMP_BR_KEYS_REQ_EVT = 12, /* SMP over BR keys request event */
  SMP_UNUSED13 = 13,
  SMP_CONSENT_REQ_EVT = 14, /* Consent request event */
} tSMP_EVT;

/* pairing failure reason code */
#define SMP_PASSKEY_ENTRY_FAIL 0x01