Skip to content

Commit

Permalink
Do not keep non-Matter UUIDs in BleUUID.h
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq committed Jun 5, 2024
1 parent 17926e2 commit 0087f80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/ble/BleUUID.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ constexpr std::pair<bool, ChipBleUUID> StringToUUID(const char (&str)[N])
// 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";
Expand Down
7 changes: 5 additions & 2 deletions src/platform/Tizen/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ namespace Internal {

namespace {

// Bluetooth SIG defined UUID for Client Characteristic Configuration Descriptor
constexpr const char * kClientCharacteristicConfigurationUUID = "2902";

constexpr System::Clock::Timeout kNewConnectionScanTimeout = System::Clock::Seconds16(20);
constexpr System::Clock::Timeout kConnectTimeout = System::Clock::Seconds16(20);
constexpr System::Clock::Timeout kFastAdvertiseTimeout =
Expand Down Expand Up @@ -631,10 +634,10 @@ CHIP_ERROR BLEManagerImpl::RegisterGATTServer()
ChipLogError(DeviceLayer, "bt_gatt_server_set_characteristic_notification_state_change_cb() failed: %s",
get_error_message(ret)));

// Create CCC Descriptor for 2nd Characteristic
ret = bt_gatt_descriptor_create(Ble::CHIP_BLE_DESC_SHORT_UUID_STR, BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE,
ret = bt_gatt_descriptor_create(kClientCharacteristicConfigurationUUID, BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE,
desc_value, sizeof(desc_value), &desc);
VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_descriptor_create() failed: %s", get_error_message(ret)));

ret = bt_gatt_characteristic_add_descriptor(char2, desc);
VerifyOrExit(ret == BT_ERROR_NONE,
ChipLogError(DeviceLayer, "bt_gatt_characteristic_add_descriptor() failed: %s", get_error_message(ret)));
Expand Down

0 comments on commit 0087f80

Please sign in to comment.