Skip to content

Commit 00aa101

Browse files
Make BLE UUID string constants lowercase (#33692)
* make BLE UUID constants be lowercase, add note about bluez * Restyle --------- Co-authored-by: Andrei Litvin <andreilitvin@google.com>
1 parent 10d7d9a commit 00aa101

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/ble/BleUUID.h

+15-9
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,22 @@ constexpr std::pair<bool, ChipBleUUID> StringToUUID(const char (&str)[N])
9595
}();
9696

9797
// UUID of CHIP BLE service.
98+
// NOTE: lower-case string seems to be required at least by bluez when
99+
// executing g_variant_lookup_value
100+
//
101+
// BlueZ API https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/org.bluez.Device.rst
102+
// describes ServiceData as "Keys are the UUIDs in string format" however no description
103+
// on actual case required
98104
inline constexpr char CHIP_BLE_DESC_SHORT_UUID_STR[] = "2902";
99-
inline constexpr char CHIP_BLE_SERVICE_SHORT_UUID_STR[] = "FFF6";
100-
inline constexpr char CHIP_BLE_SERVICE_LONG_UUID_STR[] = "0000FFF6-0000-1000-8000-00805F9B34FB";
101-
inline constexpr char CHIP_BLE_CHAR_1_UUID_STR[] = "18EE2EF5-263D-4559-959F-4F9C429F9D11";
102-
inline constexpr char CHIP_BLE_CHAR_2_UUID_STR[] = "18EE2EF5-263D-4559-959F-4F9C429F9D12";
103-
inline constexpr char CHIP_BLE_CHAR_3_UUID_STR[] = "64630238-8772-45F2-B87D-748A83218F04";
104-
inline constexpr ChipBleUUID CHIP_BLE_SVC_ID = StringToUUIDConstexpr("0000FFF6-0000-1000-8000-00805F9B34FB");
105-
inline constexpr ChipBleUUID CHIP_BLE_CHAR_1_UUID = StringToUUIDConstexpr("18EE2EF5-263D-4559-959F-4F9C429F9D11");
106-
inline constexpr ChipBleUUID CHIP_BLE_CHAR_2_UUID = StringToUUIDConstexpr("18EE2EF5-263D-4559-959F-4F9C429F9D12");
107-
inline constexpr ChipBleUUID CHIP_BLE_CHAR_3_UUID = StringToUUIDConstexpr("64630238-8772-45F2-B87D-748A83218F04");
105+
inline constexpr char CHIP_BLE_SERVICE_SHORT_UUID_STR[] = "fff6";
106+
inline constexpr char CHIP_BLE_SERVICE_LONG_UUID_STR[] = "0000fff6-0000-1000-8000-00805f9b34fb";
107+
inline constexpr char CHIP_BLE_CHAR_1_UUID_STR[] = "18ee2ef5-263d-4559-959f-4f9c429f9d11";
108+
inline constexpr char CHIP_BLE_CHAR_2_UUID_STR[] = "18ee2ef5-263d-4559-959f-4f9c429f9d12";
109+
inline constexpr char CHIP_BLE_CHAR_3_UUID_STR[] = "64630238-8772-45f2-b87d-748a83218f04";
110+
inline constexpr ChipBleUUID CHIP_BLE_SVC_ID = StringToUUIDConstexpr("0000fff6-0000-1000-8000-00805f9b34fb");
111+
inline constexpr ChipBleUUID CHIP_BLE_CHAR_1_UUID = StringToUUIDConstexpr("18ee2ef5-263d-4559-959f-4f9c429f9d11");
112+
inline constexpr ChipBleUUID CHIP_BLE_CHAR_2_UUID = StringToUUIDConstexpr("18ee2ef5-263d-4559-959f-4f9c429f9d12");
113+
inline constexpr ChipBleUUID CHIP_BLE_CHAR_3_UUID = StringToUUIDConstexpr("64630238-8772-45f2-b87d-748a83218f04");
108114

109115
} /* namespace Ble */
110116
} /* namespace chip */

0 commit comments

Comments
 (0)