From: Chris Manton Date: Thu, 17 Sep 2020 21:51:17 +0000 (-0700) Subject: enum-ify stack/include/::BT_DEVICE_TYPE_ X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=70bbd91fc8;p=android-x86%2Fsystem-bt.git enum-ify stack/include/::BT_DEVICE_TYPE_ Towards readable code Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Change-Id: I58b0524279c97c98db08d299b41d6d9bf3fe7a83 --- diff --git a/stack/include/bt_types.h b/stack/include/bt_types.h index 27b808254..c8958e2d2 100644 --- a/stack/include/bt_types.h +++ b/stack/include/bt_types.h @@ -801,9 +801,11 @@ struct tBLE_BD_ADDR { /* Device Types */ -#define BT_DEVICE_TYPE_BREDR 0x01 -#define BT_DEVICE_TYPE_BLE 0x02 -#define BT_DEVICE_TYPE_DUMO 0x03 +enum : uint8_t { + BT_DEVICE_TYPE_BREDR = (1 << 0), + BT_DEVICE_TYPE_BLE = (1 << 1), + BT_DEVICE_TYPE_DUMO = BT_DEVICE_TYPE_BREDR | BT_DEVICE_TYPE_BLE, +}; typedef uint8_t tBT_DEVICE_TYPE; #ifdef __cplusplus inline std::string DeviceTypeText(tBT_DEVICE_TYPE type) {