From: Chris Manton Date: Thu, 17 Sep 2020 21:28:57 +0000 (-0700) Subject: enum-ify tBTM_BLE_RL_STATE X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2eb93aa713;p=android-x86%2Fsystem-bt.git enum-ify tBTM_BLE_RL_STATE Towards readable code Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Change-Id: I00e719325aad11eb2ac4c92b0db065b72f188df4 --- 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;