From 2eb93aa713bd862c40cc842e33b5a9410f2b3a4e Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Thu, 17 Sep 2020 14:28:57 -0700 Subject: [PATCH] enum-ify tBTM_BLE_RL_STATE Towards readable code Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Change-Id: I00e719325aad11eb2ac4c92b0db065b72f188df4 --- stack/btm/btm_ble_int_types.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stack/btm/btm_ble_int_types.h b/stack/btm/btm_ble_int_types.h index a57ca1890..86fa48413 100644 --- a/stack/btm/btm_ble_int_types.h +++ b/stack/btm/btm_ble_int_types.h @@ -160,10 +160,12 @@ constexpr uint8_t BTM_BLE_WL_IDLE = 0; constexpr uint8_t BTM_BLE_WL_INIT = 1; /* resolving list using state as a bit mask */ -#define BTM_BLE_RL_IDLE 0 -#define BTM_BLE_RL_INIT 1 -#define BTM_BLE_RL_SCAN 2 -#define BTM_BLE_RL_ADV 4 +enum : uint8_t { + BTM_BLE_RL_IDLE = 0, + BTM_BLE_RL_INIT = (1 << 0), + BTM_BLE_RL_SCAN = (1 << 1), + BTM_BLE_RL_ADV = (1 << 2), +}; typedef uint8_t tBTM_BLE_RL_STATE; typedef struct { void* p_param; } tBTM_BLE_CONN_REQ; -- 2.11.0