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

Commit 62fe9dcd authored by Chris Manton's avatar Chris Manton
Browse files

enum-ify stack/include/smp_api_types::SMP_OPCODE

Toward readable code

Bug: 163134718
Tag: #refactor
Test: Paired phones on le link

Change-Id: Ia125cf73a67b8244d45d83959fd3ac7cff41b76e
parent 20fff8ce
Loading
Loading
Loading
Loading
+19 −17
Original line number Diff line number Diff line
@@ -23,23 +23,25 @@
#include "types/ble_address_with_type.h"

/* SMP command code */
#define SMP_OPCODE_PAIRING_REQ 0x01
#define SMP_OPCODE_PAIRING_RSP 0x02
#define SMP_OPCODE_CONFIRM 0x03
#define SMP_OPCODE_RAND 0x04
#define SMP_OPCODE_PAIRING_FAILED 0x05
#define SMP_OPCODE_ENCRYPT_INFO 0x06
#define SMP_OPCODE_CENTRAL_ID 0x07
#define SMP_OPCODE_IDENTITY_INFO 0x08
#define SMP_OPCODE_ID_ADDR 0x09
#define SMP_OPCODE_SIGN_INFO 0x0A
#define SMP_OPCODE_SEC_REQ 0x0B
#define SMP_OPCODE_PAIR_PUBLIC_KEY 0x0C
#define SMP_OPCODE_PAIR_DHKEY_CHECK 0x0D
#define SMP_OPCODE_PAIR_KEYPR_NOTIF 0x0E
#define SMP_OPCODE_MAX SMP_OPCODE_PAIR_KEYPR_NOTIF
#define SMP_OPCODE_MIN SMP_OPCODE_PAIRING_REQ
#define SMP_OPCODE_PAIR_COMMITM 0x0F
typedef enum : uint8_t {
  SMP_OPCODE_PAIRING_REQ = 0x01,
  SMP_OPCODE_PAIRING_RSP = 0x02,
  SMP_OPCODE_CONFIRM = 0x03,
  SMP_OPCODE_RAND = 0x04,
  SMP_OPCODE_PAIRING_FAILED = 0x05,
  SMP_OPCODE_ENCRYPT_INFO = 0x06,
  SMP_OPCODE_CENTRAL_ID = 0x07,
  SMP_OPCODE_IDENTITY_INFO = 0x08,
  SMP_OPCODE_ID_ADDR = 0x09,
  SMP_OPCODE_SIGN_INFO = 0x0A,
  SMP_OPCODE_SEC_REQ = 0x0B,
  SMP_OPCODE_PAIR_PUBLIC_KEY = 0x0C,
  SMP_OPCODE_PAIR_DHKEY_CHECK = 0x0D,
  SMP_OPCODE_PAIR_KEYPR_NOTIF = 0x0E,
  SMP_OPCODE_MAX = SMP_OPCODE_PAIR_KEYPR_NOTIF,
  SMP_OPCODE_MIN = SMP_OPCODE_PAIRING_REQ,
  SMP_OPCODE_PAIR_COMMITM = 0x0F,
} tSMP_OPCODE;

/* SMP event type */
#define SMP_IO_CAP_REQ_EVT 1     /* IO capability request event */