From: Chris Manton Date: Tue, 2 Mar 2021 20:32:59 +0000 (-0800) Subject: Enum-ify tSMP_EVT X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b7313a27d4d43a129f832edcd842903b4d0ca1ad;p=android-x86%2Fsystem-bt.git Enum-ify tSMP_EVT Toward readable code Bug: 163134718 Test: gd/cert/run Tag: #refactor Change-Id: I12e2d8d7d1f8ddb05a6b9b673c74013fda5a0d22 --- diff --git a/stack/include/smp_api_types.h b/stack/include/smp_api_types.h index 631812999..955402b03 100644 --- a/stack/include/smp_api_types.h +++ b/stack/include/smp_api_types.h @@ -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 */ - -/* SC OOB request event (both local and peer OOB data can be expected in - * response) */ -#define 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; +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) */ + SMP_SC_OOB_REQ_EVT = 9, + /* SC OOB local data set is created (as result of SMP_CrLocScOobData(...)) */ + 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