OSDN Git Service

enum-ify stack/include/btm_ble_api_types::tBTM_BLE_EVT
authorChris Manton <cmanton@google.com>
Thu, 17 Sep 2020 23:50:12 +0000 (16:50 -0700)
committerChris Manton <cmanton@google.com>
Sat, 19 Sep 2020 19:49:18 +0000 (19:49 +0000)
Towards readable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Id646fcf3450073c851038a01dcb5917d7d5a0793

stack/include/btm_ble_api_types.h

index 055f5ac..cc418c2 100644 (file)
@@ -40,13 +40,13 @@ enum : uint8_t {
 };
 
 /* 0x00 - 0x04 can be received on adv event type */
-#define BTM_BLE_ADV_IND_EVT  0x00
-#define BTM_BLE_ADV_DIRECT_IND_EVT  0x01
-#define BTM_BLE_ADV_SCAN_IND_EVT  0x02
-#define BTM_BLE_ADV_NONCONN_IND_EVT  0x03
-#define BTM_BLE_SCAN_RSP_EVT 0x04
-
-typedef uint8_t tBTM_BLE_EVT;
+typedef enum : uint8_t {
+  BTM_BLE_ADV_IND_EVT = 0x00,
+  BTM_BLE_ADV_DIRECT_IND_EVT = 0x01,
+  BTM_BLE_ADV_SCAN_IND_EVT = 0x02,
+  BTM_BLE_ADV_NONCONN_IND_EVT = 0x03,
+  BTM_BLE_SCAN_RSP_EVT = 0x04,
+} tBTM_BLE_EVT;
 
 typedef uint32_t tBTM_BLE_REF_VALUE;