Skip to content

Commit

Permalink
Make BLE UUID string constants lowercase (#33692)
Browse files Browse the repository at this point in the history
* make BLE UUID constants be lowercase, add note about bluez

* Restyle

---------

Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jul 29, 2024
1 parent 5e7fe21 commit 1096044
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/ble/BleUUID.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,22 @@ constexpr std::pair<bool, ChipBleUUID> StringToUUID(const char (&str)[N])
}();

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

} /* namespace Ble */
} /* namespace chip */

0 comments on commit 1096044

Please sign in to comment.