OSDN Git Service

enum-ify fixed_cid stack/include/l2cdefs::L2CAP_
authorChris Manton <cmanton@google.com>
Thu, 19 Nov 2020 16:48:46 +0000 (08:48 -0800)
committerChris Manton <cmanton@google.com>
Tue, 1 Dec 2020 04:17:21 +0000 (04:17 +0000)
Towards readable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host
Change-Id: If792e68c92adb0431526942ac4f9274b1d1db45f

stack/include/l2cdefs.h

index 74bc241..9a60915 100644 (file)
@@ -174,14 +174,16 @@ inline std::string l2cap_le_result_code_text(
 
 /* L2CAP Predefined CIDs
 */
-#define L2CAP_SIGNALLING_CID 1
-#define L2CAP_CONNECTIONLESS_CID 2
-#define L2CAP_AMP_CID 3
-#define L2CAP_ATT_CID 4
-#define L2CAP_BLE_SIGNALLING_CID 5
-#define L2CAP_SMP_CID 6
-#define L2CAP_SMP_BR_CID 7
-#define L2CAP_BASE_APPL_CID 0x0040
+enum : uint16_t {
+  L2CAP_SIGNALLING_CID = 1,
+  L2CAP_CONNECTIONLESS_CID = 2,
+  L2CAP_AMP_CID = 3,
+  L2CAP_ATT_CID = 4,
+  L2CAP_BLE_SIGNALLING_CID = 5,
+  L2CAP_SMP_CID = 6,
+  L2CAP_SMP_BR_CID = 7,
+  L2CAP_BASE_APPL_CID = 0x0040,
+};
 
 /* Fixed Channels mask bits */