OSDN Git Service

enum-ify tBTM_BLE_CONN_ST
authorChris Manton <cmanton@google.com>
Sun, 30 Aug 2020 03:47:05 +0000 (20:47 -0700)
committerChris Manton <cmanton@google.com>
Sun, 30 Aug 2020 16:42:46 +0000 (09:42 -0700)
Towards readable code

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

stack/btm/btm_ble_int_types.h

index 7f0fb95..8c3131c 100644 (file)
@@ -167,10 +167,11 @@ constexpr uint8_t BTM_BLE_WL_INIT = 1;
 typedef uint8_t tBTM_BLE_RL_STATE;
 
 /* BLE connection state */
-#define BLE_CONN_IDLE 0
-#define BLE_CONNECTING 2
-#define BLE_CONN_CANCEL 3
-typedef uint8_t tBTM_BLE_CONN_ST;
+typedef enum : uint8_t {
+  BLE_CONN_IDLE = 0,
+  BLE_CONNECTING = 2,
+  BLE_CONN_CANCEL = 3,
+} tBTM_BLE_CONN_ST;
 
 typedef struct { void* p_param; } tBTM_BLE_CONN_REQ;