From d12b086728bfd44a032edd8e06122e780d761b93 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Thu, 17 Sep 2020 16:31:31 -0700 Subject: [PATCH] enum-ify BTM_BLE_ events Towards readable code Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Change-Id: Ica632f9050ac8efeaa67a3178286015b2bec2a4b --- stack/include/btm_ble_api_types.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/stack/include/btm_ble_api_types.h b/stack/include/btm_ble_api_types.h index 7978567b3..055f5ace4 100644 --- a/stack/include/btm_ble_api_types.h +++ b/stack/include/btm_ble_api_types.h @@ -26,16 +26,19 @@ #define CHNL_MAP_LEN 5 typedef uint8_t tBTM_BLE_CHNL_MAP[CHNL_MAP_LEN]; -/* 0x00-0x04 only used for set advertising parameter command */ -#define BTM_BLE_CONNECT_EVT 0x00 -/* Connectable directed advertising */ -#define BTM_BLE_CONNECT_DIR_EVT 0x01 -/* Scannable undirected advertising */ -#define BTM_BLE_DISCOVER_EVT 0x02 -/* Non connectable undirected advertising */ -#define BTM_BLE_NON_CONNECT_EVT 0x03 -/* Connectable low duty cycle directed advertising */ -#define BTM_BLE_CONNECT_LO_DUTY_DIR_EVT 0x04 +enum : uint8_t { + /* 0x00-0x04 only used for set advertising parameter command */ + BTM_BLE_CONNECT_EVT = 0x00, + /* Connectable directed advertising */ + BTM_BLE_CONNECT_DIR_EVT = 0x01, + /* Scannable undirected advertising */ + BTM_BLE_DISCOVER_EVT = 0x02, + /* Non connectable undirected advertising */ + BTM_BLE_NON_CONNECT_EVT = 0x03, + /* Connectable low duty cycle directed advertising */ + BTM_BLE_CONNECT_LO_DUTY_DIR_EVT = 0x04, +}; + /* 0x00 - 0x04 can be received on adv event type */ #define BTM_BLE_ADV_IND_EVT 0x00 #define BTM_BLE_ADV_DIRECT_IND_EVT 0x01 -- 2.11.0