diff --git a/src/ble/BLEEndPoint.cpp b/src/ble/BLEEndPoint.cpp
index 0e69e59..78e74bd 100644
--- a/src/ble/BLEEndPoint.cpp
+++ b/src/ble/BLEEndPoint.cpp
@@ -389,7 +389,7 @@
             // Indicate close of chipConnection to peripheral via GATT unsubscribe. Keep end point allocated until
             // unsubscribe completes or times out, so platform doesn't close underlying BLE connection before
             // we're really sure the unsubscribe request has been sent.
-            if (!mBle->mPlatformDelegate->UnsubscribeCharacteristic(mConnObj, &CHIP_BLE_SVC_ID, &mBle->CHIP_BLE_CHAR_2_ID))
+            if (!mBle->mPlatformDelegate->UnsubscribeCharacteristic(mConnObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID))
             {
                 ChipLogError(Ble, "BtpEngine unsub failed");
 
@@ -750,7 +750,7 @@
     {
         // Subscribe to characteristic which peripheral will use to send indications. Prompts peripheral to send
         // BLE transport capabilities indication.
-        VerifyOrExit(mBle->mPlatformDelegate->SubscribeCharacteristic(mConnObj, &CHIP_BLE_SVC_ID, &mBle->CHIP_BLE_CHAR_2_ID),
+        VerifyOrExit(mBle->mPlatformDelegate->SubscribeCharacteristic(mConnObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID),
                      err = BLE_ERROR_GATT_SUBSCRIBE_FAILED);
 
         // We just sent a GATT subscribe request, so make sure to attempt unsubscribe on close.
@@ -1313,14 +1313,14 @@
 {
     mConnStateFlags.Set(ConnectionStateFlag::kGattOperationInFlight);
 
-    return mBle->mPlatformDelegate->SendWriteRequest(mConnObj, &CHIP_BLE_SVC_ID, &mBle->CHIP_BLE_CHAR_1_ID, std::move(buf));
+    return mBle->mPlatformDelegate->SendWriteRequest(mConnObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID, std::move(buf));
 }
 
 bool BLEEndPoint::SendIndication(PacketBufferHandle && buf)
 {
     mConnStateFlags.Set(ConnectionStateFlag::kGattOperationInFlight);
 
-    return mBle->mPlatformDelegate->SendIndication(mConnObj, &CHIP_BLE_SVC_ID, &mBle->CHIP_BLE_CHAR_2_ID, std::move(buf));
+    return mBle->mPlatformDelegate->SendIndication(mConnObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID, std::move(buf));
 }
 
 CHIP_ERROR BLEEndPoint::StartConnectTimer()
diff --git a/src/ble/BleLayer.cpp b/src/ble/BleLayer.cpp
index de1f845..3e1473a 100644
--- a/src/ble/BleLayer.cpp
+++ b/src/ble/BleLayer.cpp
@@ -138,20 +138,6 @@
 //
 static BleEndPointPool sBLEEndPointPool;
 
-// UUIDs used internally by BleLayer:
-
-const ChipBleUUID BleLayer::CHIP_BLE_CHAR_1_ID = { { // 18EE2EF5-263D-4559-959F-4F9C429F9D11
-                                                     0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42,
-                                                     0x9F, 0x9D, 0x11 } };
-
-const ChipBleUUID BleLayer::CHIP_BLE_CHAR_2_ID = { { // 18EE2EF5-263D-4559-959F-4F9C429F9D12
-                                                     0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42,
-                                                     0x9F, 0x9D, 0x12 } };
-
-const ChipBleUUID BleLayer::CHIP_BLE_CHAR_3_ID = { { // 64630238-8772-45F2-B87D-748A83218F04
-                                                     0x64, 0x63, 0x02, 0x38, 0x87, 0x72, 0x45, 0xF2, 0xB8, 0x7D, 0x74, 0x8A, 0x83,
-                                                     0x21, 0x8F, 0x04 } };
-
 // BleTransportCapabilitiesRequestMessage implementation:
 
 void BleTransportCapabilitiesRequestMessage::SetSupportedProtocolVersion(uint8_t index, uint8_t version)
@@ -486,7 +472,7 @@
                                    PacketBufferHandle && pBuf)
 {
     VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Write received on unknown svc"));
-    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_1_ID, charId), false, ChipLogError(Ble, "Write received on unknown char"));
+    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_1_UUID, charId), false, ChipLogError(Ble, "Write received on unknown char"));
     VerifyOrReturnError(!pBuf.IsNull(), false, ChipLogError(Ble, "Write received null buffer"));
 
     // Find matching connection end point.
@@ -512,7 +498,7 @@
                                         PacketBufferHandle && pBuf)
 {
     VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Indication received on unknown svc"));
-    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId), false, ChipLogError(Ble, "Indication received on unknown char"));
+    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId), false, ChipLogError(Ble, "Indication received on unknown char"));
     VerifyOrReturnError(!pBuf.IsNull(), false, ChipLogError(Ble, "Indication received null buffer"));
 
     // Find matching connection end point.
@@ -528,7 +514,7 @@
 bool BleLayer::HandleWriteConfirmation(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId)
 {
     VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Write confirmation on unknown svc"));
-    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_1_ID, charId), false, ChipLogError(Ble, "Write confirmation on unknown char"));
+    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_1_UUID, charId), false, ChipLogError(Ble, "Write confirmation on unknown char"));
 
     HandleAckReceived(connObj);
     return true;
@@ -537,7 +523,7 @@
 bool BleLayer::HandleIndicationConfirmation(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId)
 {
     VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Indication confirmation on unknown svc"));
-    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId), false,
+    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId), false,
                         ChipLogError(Ble, "Indication confirmation on unknown char"));
 
     HandleAckReceived(connObj);
@@ -558,7 +544,7 @@
 bool BleLayer::HandleSubscribeReceived(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId)
 {
     VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Subscribe received on unknown svc"));
-    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_ID, charId), false,
+    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_UUID, charId), false,
                         ChipLogError(Ble, "Subscribe received on unknown char"));
 
     // Find end point already associated with BLE connection, if any.
@@ -572,7 +558,7 @@
 bool BleLayer::HandleSubscribeComplete(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId)
 {
     VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Subscribe complete on unknown svc"));
-    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_ID, charId), false,
+    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_UUID, charId), false,
                         ChipLogError(Ble, "Subscribe complete on unknown char"));
 
     BLEEndPoint * endPoint = sBLEEndPointPool.Find(connObj);
@@ -585,7 +571,7 @@
 bool BleLayer::HandleUnsubscribeReceived(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId)
 {
     VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Unsubscribe received on unknown svc"));
-    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_ID, charId), false,
+    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_UUID, charId), false,
                         ChipLogError(Ble, "Unsubscribe received on unknown char"));
 
     // Find end point already associated with BLE connection, if any.
@@ -599,7 +585,7 @@
 bool BleLayer::HandleUnsubscribeComplete(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId)
 {
     VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Unsubscribe complete on unknown svc"));
-    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_ID, charId), false,
+    VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_UUID, charId), false,
                         ChipLogError(Ble, "Unsubscribe complete on unknown char"));
 
     // Find end point already associated with BLE connection, if any.
diff --git a/src/ble/BleLayer.h b/src/ble/BleLayer.h
index e7d619f..7056a09 100644
--- a/src/ble/BleLayer.h
+++ b/src/ble/BleLayer.h
@@ -313,13 +313,6 @@
 private:
     // Private data members:
 
-    // UUID of CHIP service characteristic used for central writes.
-    static const ChipBleUUID CHIP_BLE_CHAR_1_ID;
-    // UUID of CHIP service characteristic used for peripheral indications.
-    static const ChipBleUUID CHIP_BLE_CHAR_2_ID;
-    // UUID of CHIP service characteristic used for additional data
-    static const ChipBleUUID CHIP_BLE_CHAR_3_ID;
-
     BleConnectionDelegate * mConnectionDelegate;
     BlePlatformDelegate * mPlatformDelegate;
     BleApplicationDelegate * mApplicationDelegate;
diff --git a/src/ble/BleUUID.cpp b/src/ble/BleUUID.cpp
index 098595f..f42fc98 100644
--- a/src/ble/BleUUID.cpp
+++ b/src/ble/BleUUID.cpp
@@ -26,15 +26,6 @@
 namespace chip {
 namespace Ble {
 
-const ChipBleUUID CHIP_BLE_SVC_ID = { { // 0000FFF6-0000-1000-8000-00805F9B34FB
-                                        0x00, 0x00, 0xFF, 0xF6, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34,
-                                        0xFB } };
-
-inline static uint8_t HexDigitToInt(const char c)
-{
-    return static_cast<uint8_t>(c >= '0' && c <= '9' ? c - '0' : tolower(c) - 'a' + 10);
-}
-
 bool UUIDsMatch(const ChipBleUUID * idOne, const ChipBleUUID * idTwo)
 {
     if ((idOne == nullptr) || (idTwo == nullptr))
@@ -44,35 +35,5 @@
     return (memcmp(idOne->bytes, idTwo->bytes, 16) == 0);
 }
 
-// Convert a string like "0000FFF6-0000-1000-8000-00805F9B34FB" to binary UUID
-bool StringToUUID(const char * str, ChipBleUUID & uuid)
-{
-    constexpr size_t NUM_UUID_NIBBLES = sizeof(uuid.bytes) * 2;
-    size_t nibbleId                   = 0;
-
-    for (; *str; ++str)
-    {
-        if (*str == '-') // skip separators
-            continue;
-
-        if (!isxdigit(*str)) // invalid character!
-            return false;
-
-        if (nibbleId >= NUM_UUID_NIBBLES) // too long string!
-            return false;
-
-        uint8_t & byte = uuid.bytes[nibbleId / 2];
-        if (nibbleId % 2 == 0)
-            byte = static_cast<uint8_t>(HexDigitToInt(*str) << 4);
-        else
-            byte = static_cast<uint8_t>(byte | HexDigitToInt(*str));
-
-        ++nibbleId;
-    }
-
-    // All bytes were initialized?
-    return nibbleId == NUM_UUID_NIBBLES;
-}
-
 } /* namespace Ble */
 } /* namespace chip */
diff --git a/src/ble/BleUUID.h b/src/ble/BleUUID.h
index 315af9e..6470cfe 100644
--- a/src/ble/BleUUID.h
+++ b/src/ble/BleUUID.h
@@ -22,7 +22,9 @@
 #error "Please include <ble/Ble.h> instead!"
 #endif
 
+#include <cstddef>
 #include <cstdint>
+#include <utility>
 
 namespace chip {
 namespace Ble {
@@ -36,11 +38,73 @@
     uint8_t bytes[16];
 };
 
-// UUID of CHIP BLE service. Exposed for use in scan filter.
-extern const ChipBleUUID CHIP_BLE_SVC_ID;
+constexpr bool isValidHexChar(char c)
+{
+    return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
+}
+
+constexpr uint8_t HexDigitToInt(const char c)
+{
+    if (c >= '0' && c <= '9')
+        return static_cast<uint8_t>(c - '0');
+    else
+        return static_cast<uint8_t>((c >= 'a' ? c - 'a' : c - 'A') + 10);
+}
 
 bool UUIDsMatch(const ChipBleUUID * idOne, const ChipBleUUID * idTwo);
-bool StringToUUID(const char * str, ChipBleUUID & uuid);
+
+/*
+ * StringToUUID converts a string representation of a UUID to a binary UUID.
+ * The string representation must be in the format "0000FFF6-0000-1000-8000-00805F9B34FB".
+ * The function returns a pair of a boolean indicating whether the conversion was successful
+ * and the binary UUID.
+ *
+ */
+template <size_t N>
+constexpr std::pair<bool, ChipBleUUID> StringToUUID(const char (&str)[N])
+{
+    constexpr size_t UUID_LEN         = 16;
+    constexpr size_t NUM_UUID_NIBBLES = UUID_LEN * 2;
+    static_assert(N >= NUM_UUID_NIBBLES);
+    ChipBleUUID uuid{};
+
+    size_t nibbleId = 0;
+    for (size_t i = 0; i < N - 1; ++i)
+    {
+        if (str[i] == '-')
+            continue;
+        if (!isValidHexChar(str[i]))
+            return { false, {} };
+        if (nibbleId >= NUM_UUID_NIBBLES)
+            return { false, {} };
+        uint8_t & byte = uuid.bytes[nibbleId / 2];
+        if (nibbleId % 2 == 0)
+            byte = static_cast<uint8_t>(HexDigitToInt(str[i]) << 4);
+        else
+            byte = static_cast<uint8_t>(byte | HexDigitToInt(str[i]));
+        ++nibbleId;
+    }
+    return { nibbleId == NUM_UUID_NIBBLES, uuid };
+}
+
+#define StringToUUIDConstexpr(str)                                                                                                 \
+    []() {                                                                                                                         \
+        constexpr std::pair<bool, ::chip::Ble::ChipBleUUID> res = ::chip::Ble::StringToUUID(str);                                  \
+        static_assert(res.first, "Argument: \"" #str "\" is not valid hex string");                                                \
+        return res.second;                                                                                                         \
+    }();
+
+// UUID of CHIP BLE service.
+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");
 
 } /* namespace Ble */
 } /* namespace chip */
diff --git a/src/ble/tests/TestBleLayer.cpp b/src/ble/tests/TestBleLayer.cpp
index 9b79037..968293d 100644
--- a/src/ble/tests/TestBleLayer.cpp
+++ b/src/ble/tests/TestBleLayer.cpp
@@ -44,14 +44,6 @@
 namespace {
 
 constexpr ChipBleUUID uuidZero{};
-constexpr ChipBleUUID uuidSvc   = { { 0x00, 0x00, 0xFF, 0xF6, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34,
-                                      0xFB } };
-constexpr ChipBleUUID uuidChar1 = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, 0x9D,
-                                      0x11 } };
-constexpr ChipBleUUID uuidChar2 = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, 0x9D,
-                                      0x12 } };
-constexpr ChipBleUUID uuidChar3 = { { 0x64, 0x63, 0x02, 0x38, 0x87, 0x72, 0x45, 0xF2, 0xB8, 0x7D, 0x74, 0x8A, 0x83, 0x21, 0x8F,
-                                      0x04 } };
 
 }; // namespace
 
@@ -111,14 +103,14 @@
     {
         constexpr uint8_t capReq[] = { 0x65, 0x6c, 0x54, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06 };
         auto buf                   = System::PacketBufferHandle::NewWithData(capReq, sizeof(capReq));
-        return HandleWriteReceived(connObj, &uuidSvc, &uuidChar1, std::move(buf));
+        return HandleWriteReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID, std::move(buf));
     }
 
     // Processing subscription request after capabilities request should finalize
     // connection establishment.
     bool HandleSubscribeReceivedOnChar2(BLE_CONNECTION_OBJECT connObj)
     {
-        return HandleSubscribeReceived(connObj, &uuidSvc, &uuidChar2);
+        return HandleSubscribeReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID);
     }
 
     ///
@@ -220,7 +212,7 @@
 {
     auto connObj = GetConnectionObject();
     EXPECT_FALSE(HandleSubscribeReceived(connObj, &uuidZero, &uuidZero));
-    EXPECT_FALSE(HandleSubscribeReceived(connObj, &uuidSvc, &uuidChar1));
+    EXPECT_FALSE(HandleSubscribeReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID));
 }
 
 TEST_F(TestBleLayer, HandleSubscribeReceived)
@@ -234,7 +226,7 @@
 {
     auto connObj = GetConnectionObject();
     EXPECT_FALSE(HandleSubscribeComplete(connObj, &uuidZero, &uuidZero));
-    EXPECT_FALSE(HandleSubscribeComplete(connObj, &uuidSvc, &uuidChar1));
+    EXPECT_FALSE(HandleSubscribeComplete(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID));
 }
 
 TEST_F(TestBleLayer, HandleSubscribeComplete)
@@ -243,14 +235,14 @@
     ASSERT_TRUE(HandleWriteReceivedCapabilitiesRequest(connObj));
     ASSERT_TRUE(HandleSubscribeReceivedOnChar2(connObj));
 
-    EXPECT_TRUE(HandleSubscribeComplete(connObj, &uuidSvc, &uuidChar2));
+    EXPECT_TRUE(HandleSubscribeComplete(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID));
 }
 
 TEST_F(TestBleLayer, HandleUnsubscribeReceivedInvalidUUID)
 {
     auto connObj = GetConnectionObject();
     EXPECT_FALSE(HandleUnsubscribeReceived(connObj, &uuidZero, &uuidZero));
-    EXPECT_FALSE(HandleUnsubscribeReceived(connObj, &uuidSvc, &uuidChar1));
+    EXPECT_FALSE(HandleUnsubscribeReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID));
 }
 
 TEST_F(TestBleLayer, HandleUnsubscribeReceived)
@@ -259,14 +251,14 @@
     ASSERT_TRUE(HandleWriteReceivedCapabilitiesRequest(connObj));
     ASSERT_TRUE(HandleSubscribeReceivedOnChar2(connObj));
 
-    EXPECT_TRUE(HandleUnsubscribeReceived(connObj, &uuidSvc, &uuidChar2));
+    EXPECT_TRUE(HandleUnsubscribeReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID));
 }
 
 TEST_F(TestBleLayer, HandleUnsubscribeCompleteInvalidUUID)
 {
     auto connObj = GetConnectionObject();
     EXPECT_FALSE(HandleUnsubscribeComplete(connObj, &uuidZero, &uuidZero));
-    EXPECT_FALSE(HandleUnsubscribeComplete(connObj, &uuidSvc, &uuidChar1));
+    EXPECT_FALSE(HandleUnsubscribeComplete(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID));
 }
 
 TEST_F(TestBleLayer, HandleUnsubscribeComplete)
@@ -275,7 +267,7 @@
     ASSERT_TRUE(HandleWriteReceivedCapabilitiesRequest(connObj));
     ASSERT_TRUE(HandleSubscribeReceivedOnChar2(connObj));
 
-    EXPECT_TRUE(HandleUnsubscribeComplete(connObj, &uuidSvc, &uuidChar2));
+    EXPECT_TRUE(HandleUnsubscribeComplete(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID));
 }
 
 TEST_F(TestBleLayer, HandleWriteReceivedInvalidUUID)
@@ -285,7 +277,7 @@
     ASSERT_FALSE(buf.IsNull());
 
     EXPECT_FALSE(HandleWriteReceived(connObj, &uuidZero, &uuidZero, buf.Retain()));
-    EXPECT_FALSE(HandleWriteReceived(connObj, &uuidSvc, &uuidChar3, std::move(buf)));
+    EXPECT_FALSE(HandleWriteReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_3_UUID, std::move(buf)));
 }
 
 TEST_F(TestBleLayer, HandleWriteReceived)
@@ -300,14 +292,14 @@
     auto buf                 = System::PacketBufferHandle::NewWithData(data, sizeof(data));
     ASSERT_FALSE(buf.IsNull());
 
-    EXPECT_TRUE(HandleWriteReceived(connObj, &uuidSvc, &uuidChar1, std::move(buf)));
+    EXPECT_TRUE(HandleWriteReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID, std::move(buf)));
 }
 
 TEST_F(TestBleLayer, HandleWriteConfirmationInvalidUUID)
 {
     auto connObj = GetConnectionObject();
     EXPECT_FALSE(HandleWriteConfirmation(connObj, &uuidZero, &uuidZero));
-    EXPECT_FALSE(HandleWriteConfirmation(connObj, &uuidSvc, &uuidChar2));
+    EXPECT_FALSE(HandleWriteConfirmation(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID));
 }
 
 TEST_F(TestBleLayer, HandleWriteConfirmationUninitialized)
@@ -320,7 +312,7 @@
     auto connObj = GetConnectionObject();
     ASSERT_TRUE(HandleWriteReceivedCapabilitiesRequest(connObj));
 
-    EXPECT_TRUE(HandleWriteConfirmation(connObj, &uuidSvc, &uuidChar1));
+    EXPECT_TRUE(HandleWriteConfirmation(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID));
 }
 
 TEST_F(TestBleLayer, HandleIndicationReceivedInvalidUUID)
@@ -330,7 +322,7 @@
     ASSERT_FALSE(buf.IsNull());
 
     EXPECT_FALSE(HandleIndicationReceived(connObj, &uuidZero, &uuidZero, buf.Retain()));
-    EXPECT_FALSE(HandleIndicationReceived(connObj, &uuidSvc, &uuidChar1, std::move(buf)));
+    EXPECT_FALSE(HandleIndicationReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID, std::move(buf)));
 }
 
 TEST_F(TestBleLayer, HandleIndicationReceived)
@@ -345,14 +337,14 @@
     auto buf                 = System::PacketBufferHandle::NewWithData(data, sizeof(data));
     ASSERT_FALSE(buf.IsNull());
 
-    EXPECT_TRUE(HandleIndicationReceived(connObj, &uuidSvc, &uuidChar2, std::move(buf)));
+    EXPECT_TRUE(HandleIndicationReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID, std::move(buf)));
 }
 
 TEST_F(TestBleLayer, HandleIndicationConfirmationInvalidUUID)
 {
     auto connObj = GetConnectionObject();
     EXPECT_FALSE(HandleIndicationConfirmation(connObj, &uuidZero, &uuidZero));
-    EXPECT_FALSE(HandleIndicationConfirmation(connObj, &uuidSvc, &uuidChar1));
+    EXPECT_FALSE(HandleIndicationConfirmation(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID));
 }
 
 TEST_F(TestBleLayer, HandleIndicationConfirmation)
@@ -360,7 +352,7 @@
     auto connObj = GetConnectionObject();
     ASSERT_TRUE(HandleWriteReceivedCapabilitiesRequest(connObj));
 
-    EXPECT_TRUE(HandleIndicationConfirmation(connObj, &uuidSvc, &uuidChar2));
+    EXPECT_TRUE(HandleIndicationConfirmation(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID));
 }
 
 TEST_F(TestBleLayer, HandleConnectionError)
diff --git a/src/ble/tests/TestBleUUID.cpp b/src/ble/tests/TestBleUUID.cpp
index 4dbc6dd..4455355 100644
--- a/src/ble/tests/TestBleUUID.cpp
+++ b/src/ble/tests/TestBleUUID.cpp
@@ -34,6 +34,9 @@
 
 namespace {
 
+constexpr ChipBleUUID expectedUUID = { { 0x00, 0x00, 0xFF, 0xF6, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34,
+                                         0xFB } };
+
 TEST(TestBleUUID, CheckUUIDsMatch_NULL)
 {
     // Test that NULL pointer UUIDs are not equal
@@ -43,46 +46,36 @@
 TEST(TestBleUUID, CheckStringToUUID_ChipUUID)
 {
     // Test positive scenario - CHIP Service UUID
-    ChipBleUUID uuid;
-    EXPECT_TRUE(StringToUUID("0000FFF6-0000-1000-8000-00805F9B34FB", uuid));
-    EXPECT_TRUE(UUIDsMatch(&uuid, &CHIP_BLE_SVC_ID));
+    ChipBleUUID uuid = StringToUUIDConstexpr("0000FFF6-0000-1000-8000-00805F9B34FB");
+    EXPECT_TRUE(UUIDsMatch(&uuid, &expectedUUID));
 }
 
 TEST(TestBleUUID, CheckStringToUUID_ChipUUID_RandomCase)
 {
     // Test that letter case doesn't matter
-    ChipBleUUID uuid;
-    EXPECT_TRUE(StringToUUID("0000FfF6-0000-1000-8000-00805f9B34Fb", uuid));
-    EXPECT_TRUE(UUIDsMatch(&uuid, &CHIP_BLE_SVC_ID));
+    ChipBleUUID uuid = StringToUUIDConstexpr("0000FfF6-0000-1000-8000-00805f9B34Fb");
+    EXPECT_TRUE(UUIDsMatch(&uuid, &expectedUUID));
 }
 
 TEST(TestBleUUID, CheckStringToUUID_ChipUUID_NoSeparators)
 {
     // Test that separators don't matter
-    ChipBleUUID uuid;
-    EXPECT_TRUE(StringToUUID("0000FFF600001000800000805F9B34FB", uuid));
-    EXPECT_TRUE(UUIDsMatch(&uuid, &CHIP_BLE_SVC_ID));
+    ChipBleUUID uuid = StringToUUIDConstexpr("0000FFF600001000800000805F9B34FB");
+    EXPECT_TRUE(UUIDsMatch(&uuid, &expectedUUID));
 }
 
 TEST(TestBleUUID, CheckStringToUUID_TooLong)
 {
     // Test that even one more digit is too much
-    ChipBleUUID uuid;
-    EXPECT_FALSE(StringToUUID("0000FFF600001000800000805F9B34FB0", uuid));
-}
-
-TEST(TestBleUUID, CheckStringToUUID_TooShort)
-{
-    // Test that even one less digit is too little
-    ChipBleUUID uuid;
-    EXPECT_FALSE(StringToUUID("0000FFF600001000800000805F9B34F", uuid));
+    auto result = StringToUUID("0000FFF600001000800000805F9B34FB0");
+    EXPECT_FALSE(result.first);
 }
 
 TEST(TestBleUUID, CheckStringToUUID_InvalidChar)
 {
     // Test that non-hex digits don't pass
-    ChipBleUUID uuid;
-    EXPECT_FALSE(StringToUUID("0000GFF6-0000-1000-8000-00805F9B34FB0", uuid));
+    auto result = StringToUUID("0000GFF6-0000-1000-8000-00805F9B34FB");
+    EXPECT_FALSE(result.first);
 }
 
 } // namespace
diff --git a/src/platform/Linux/bluez/BluezConnection.cpp b/src/platform/Linux/bluez/BluezConnection.cpp
index eeb1e7f..6ed15b5 100644
--- a/src/platform/Linux/bluez/BluezConnection.cpp
+++ b/src/platform/Linux/bluez/BluezConnection.cpp
@@ -94,7 +94,7 @@
             if (service != nullptr)
             {
                 if ((BluezIsServiceOnDevice(service, mDevice.get())) == TRUE &&
-                    (strcmp(bluez_gatt_service1_get_uuid(service), CHIP_BLE_UUID_SERVICE_STRING) == 0))
+                    (strcmp(bluez_gatt_service1_get_uuid(service), Ble::CHIP_BLE_SERVICE_LONG_UUID_STR) == 0))
                 {
                     mService.reset(service);
                     break;
@@ -111,18 +111,18 @@
             if (char1 != nullptr)
             {
                 if ((BluezIsCharOnService(char1, mService.get()) == TRUE) &&
-                    (strcmp(bluez_gatt_characteristic1_get_uuid(char1), CHIP_PLAT_BLE_UUID_C1_STRING) == 0))
+                    (strcmp(bluez_gatt_characteristic1_get_uuid(char1), Ble::CHIP_BLE_CHAR_1_UUID_STR) == 0))
                 {
                     mC1.reset(char1);
                 }
                 else if ((BluezIsCharOnService(char1, mService.get()) == TRUE) &&
-                         (strcmp(bluez_gatt_characteristic1_get_uuid(char1), CHIP_PLAT_BLE_UUID_C2_STRING) == 0))
+                         (strcmp(bluez_gatt_characteristic1_get_uuid(char1), Ble::CHIP_BLE_CHAR_2_UUID_STR) == 0))
                 {
                     mC2.reset(char1);
                 }
 #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING
                 else if ((BluezIsCharOnService(char1, mService.get()) == TRUE) &&
-                         (strcmp(bluez_gatt_characteristic1_get_uuid(char1), CHIP_PLAT_BLE_UUID_C3_STRING) == 0))
+                         (strcmp(bluez_gatt_characteristic1_get_uuid(char1), Ble::CHIP_BLE_CHAR_3_UUID_STR) == 0))
                 {
                     mC3.reset(char1);
                 }
diff --git a/src/platform/Linux/bluez/BluezEndpoint.cpp b/src/platform/Linux/bluez/BluezEndpoint.cpp
index 151c09e..55b127e 100644
--- a/src/platform/Linux/bluez/BluezEndpoint.cpp
+++ b/src/platform/Linux/bluez/BluezEndpoint.cpp
@@ -438,10 +438,10 @@
     static const char * const c3_flags[] = { "read", nullptr };
 #endif
 
-    mService.reset(CreateGattService(CHIP_BLE_UUID_SERVICE_SHORT_STRING));
+    mService.reset(CreateGattService(Ble::CHIP_BLE_SERVICE_SHORT_UUID_STR));
 
     // C1 characteristic
-    mC1.reset(CreateGattCharacteristic(mService.get(), "c1", CHIP_PLAT_BLE_UUID_C1_STRING, c1_flags));
+    mC1.reset(CreateGattCharacteristic(mService.get(), "c1", Ble::CHIP_BLE_CHAR_1_UUID_STR, c1_flags));
     g_signal_connect(mC1.get(), "handle-read-value",
                      G_CALLBACK(+[](BluezGattCharacteristic1 * aChar, GDBusMethodInvocation * aInv, GVariant * aOpt,
                                     BluezEndpoint * self) { return self->BluezCharacteristicReadValue(aChar, aInv, aOpt); }),
@@ -455,7 +455,7 @@
     g_signal_connect(mC1.get(), "handle-confirm", G_CALLBACK(BluezCharacteristicConfirmError), nullptr);
 
     // C2 characteristic
-    mC2.reset(CreateGattCharacteristic(mService.get(), "c2", CHIP_PLAT_BLE_UUID_C2_STRING, c2_flags));
+    mC2.reset(CreateGattCharacteristic(mService.get(), "c2", Ble::CHIP_BLE_CHAR_2_UUID_STR, c2_flags));
     g_signal_connect(mC2.get(), "handle-read-value",
                      G_CALLBACK(+[](BluezGattCharacteristic1 * aChar, GDBusMethodInvocation * aInv, GVariant * aOpt,
                                     BluezEndpoint * self) { return self->BluezCharacteristicReadValue(aChar, aInv, aOpt); }),
@@ -478,7 +478,7 @@
 #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING
     ChipLogDetail(DeviceLayer, "CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING is TRUE");
     // Additional data characteristics
-    mC3.reset(CreateGattCharacteristic(mService.get(), "c3", CHIP_PLAT_BLE_UUID_C3_STRING, c3_flags));
+    mC3.reset(CreateGattCharacteristic(mService.get(), "c3", Ble::CHIP_BLE_CHAR_3_UUID_STR, c3_flags));
     g_signal_connect(mC3.get(), "handle-read-value",
                      G_CALLBACK(+[](BluezGattCharacteristic1 * aChar, GDBusMethodInvocation * aInv, GVariant * aOpt,
                                     BluezEndpoint * self) { return self->BluezCharacteristicReadValue(aChar, aInv, aOpt); }),
diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.cpp b/src/platform/Linux/bluez/ChipDeviceScanner.cpp
index dcb113b..3323f1e 100644
--- a/src/platform/Linux/bluez/ChipDeviceScanner.cpp
+++ b/src/platform/Linux/bluez/ChipDeviceScanner.cpp
@@ -42,7 +42,7 @@
     GVariant * serviceData = bluez_device1_get_service_data(&aDevice);
     VerifyOrReturnError(serviceData != nullptr, false);
 
-    GAutoPtr<GVariant> dataValue(g_variant_lookup_value(serviceData, CHIP_BLE_UUID_SERVICE_STRING, nullptr));
+    GAutoPtr<GVariant> dataValue(g_variant_lookup_value(serviceData, Ble::CHIP_BLE_SERVICE_LONG_UUID_STR, nullptr));
     VerifyOrReturnError(dataValue != nullptr, false);
 
     size_t dataLen         = 0;
diff --git a/src/platform/Linux/bluez/Types.h b/src/platform/Linux/bluez/Types.h
index 95fd669..4bd2c89 100644
--- a/src/platform/Linux/bluez/Types.h
+++ b/src/platform/Linux/bluez/Types.h
@@ -110,18 +110,6 @@
 #define ADVERTISING_INTERFACE BLUEZ_INTERFACE ".LEAdvertisement1"
 #define DEVICE_INTERFACE BLUEZ_INTERFACE ".Device1"
 
-#define CHIP_PLAT_BLE_UUID_C1_STRING "18ee2ef5-263d-4559-959f-4f9c429f9d11"
-#define CHIP_PLAT_BLE_UUID_C2_STRING "18ee2ef5-263d-4559-959f-4f9c429f9d12"
-#define CHIP_PLAT_BLE_UUID_C3_STRING "64630238-8772-45F2-B87D-748A83218F04"
-
-#define CHIP_BLE_BASE_SERVICE_UUID_STRING "-0000-1000-8000-00805f9b34fb"
-#define CHIP_BLE_SERVICE_PREFIX_LENGTH 8
-#define CHIP_BLE_BASE_SERVICE_PREFIX "0000"
-#define CHIP_BLE_UUID_SERVICE_SHORT_STRING "fff6"
-
-#define CHIP_BLE_UUID_SERVICE_STRING                                                                                               \
-    CHIP_BLE_BASE_SERVICE_PREFIX CHIP_BLE_UUID_SERVICE_SHORT_STRING CHIP_BLE_BASE_SERVICE_UUID_STRING
-
 #define BLUEZ_ADV_TYPE_FLAGS 0x01
 #define BLUEZ_ADV_TYPE_SERVICE_DATA 0x16
 
diff --git a/src/platform/Tizen/BLEManagerImpl.cpp b/src/platform/Tizen/BLEManagerImpl.cpp
index a78efd9..944447d 100644
--- a/src/platform/Tizen/BLEManagerImpl.cpp
+++ b/src/platform/Tizen/BLEManagerImpl.cpp
@@ -74,14 +74,6 @@
 
 namespace {
 
-/* CHIPoBLE UUID strings */
-constexpr char chip_ble_service_uuid[]    = "0000FFF6-0000-1000-8000-00805F9B34FB";
-constexpr char chip_ble_char_c1_tx_uuid[] = "18EE2EF5-263D-4559-959F-4F9C429F9D11";
-constexpr char chip_ble_char_c2_rx_uuid[] = "18EE2EF5-263D-4559-959F-4F9C429F9D12";
-
-constexpr char chip_ble_desc_uuid_short[]    = "2902";
-constexpr char chip_ble_service_uuid_short[] = "FFF6";
-
 constexpr System::Clock::Timeout kNewConnectionScanTimeout = System::Clock::Seconds16(20);
 constexpr System::Clock::Timeout kConnectTimeout           = System::Clock::Seconds16(20);
 constexpr System::Clock::Timeout kFastAdvertiseTimeout =
@@ -582,12 +574,12 @@
     VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_server_create() failed: %s", get_error_message(ret)));
 
     // Create Service (BTP Service)
-    ret = bt_gatt_service_create(chip_ble_service_uuid, BT_GATT_SERVICE_TYPE_PRIMARY, &service);
+    ret = bt_gatt_service_create(Ble::CHIP_BLE_SERVICE_LONG_UUID_STR, BT_GATT_SERVICE_TYPE_PRIMARY, &service);
     VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_service_create() failed: %s", get_error_message(ret)));
 
     // Create 1st Characteristic (Client TX Buffer)
     ret = bt_gatt_characteristic_create(
-        chip_ble_char_c1_tx_uuid, BT_GATT_PERMISSION_WRITE,
+        Ble::CHIP_BLE_CHAR_1_UUID_STR, BT_GATT_PERMISSION_WRITE,
         BT_GATT_PROPERTY_WRITE, // Write Request is not coming if we use WITHOUT_RESPONSE property. Let's use WRITE property and
                                 // consider to use WITHOUT_RESPONSE property in the future according to the CHIP Spec 4.16.3.2. BTP
                                 // GATT Service
@@ -611,7 +603,7 @@
                  ChipLogError(DeviceLayer, "bt_gatt_service_add_characteristic() failed: %s", get_error_message(ret)));
 
     // Create 2nd Characteristic (Client RX Buffer)
-    ret = bt_gatt_characteristic_create(chip_ble_char_c2_rx_uuid, BT_GATT_PERMISSION_READ,
+    ret = bt_gatt_characteristic_create(Ble::CHIP_BLE_CHAR_2_UUID_STR, BT_GATT_PERMISSION_READ,
                                         BT_GATT_PROPERTY_READ | BT_GATT_PROPERTY_INDICATE, "CHIPoBLE_C2", strlen("CHIPoBLE_C2"),
                                         &char2);
     VerifyOrExit(ret == BT_ERROR_NONE,
@@ -637,8 +629,8 @@
                               get_error_message(ret)));
 
     // Create CCC Descriptor
-    ret = bt_gatt_descriptor_create(chip_ble_desc_uuid_short, BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE, desc_value,
-                                    sizeof(desc_value), &desc);
+    ret = bt_gatt_descriptor_create(Ble::CHIP_BLE_DESC_SHORT_UUID_STR, 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,
@@ -711,7 +703,8 @@
     VerifyOrExit(err == CHIP_NO_ERROR,
                  ChipLogError(DeviceLayer, "GetBLEDeviceIdentificationInfo() failed: %" CHIP_ERROR_FORMAT, err.Format()));
 
-    ret = bt_adapter_le_add_advertising_service_data(mAdvertiser, BT_ADAPTER_LE_PACKET_ADVERTISING, chip_ble_service_uuid_short,
+    ret = bt_adapter_le_add_advertising_service_data(mAdvertiser, BT_ADAPTER_LE_PACKET_ADVERTISING,
+                                                     Ble::CHIP_BLE_SERVICE_SHORT_UUID_STR,
                                                      reinterpret_cast<const char *>(&deviceIdInfo), sizeof(deviceIdInfo));
     VerifyOrExit(ret == BT_ERROR_NONE,
                  ChipLogError(DeviceLayer, "bt_adapter_le_add_advertising_service_data() failed: %s", get_error_message(ret)));
@@ -779,12 +772,12 @@
     VerifyOrExit(ret == BT_ERROR_NONE,
                  ChipLogError(DeviceLayer, "Failed to fetch GATT Attribute from CHAR handle: %s", get_error_message(ret)));
 
-    if (strcasecmp(uuid.get(), chip_ble_char_c1_tx_uuid) == 0)
+    if (strcasecmp(uuid.get(), Ble::CHIP_BLE_CHAR_1_UUID_STR) == 0)
     {
         ChipLogProgress(DeviceLayer, "CHIP Char C1 TX Found [%s]", StringOrNullMarker(uuid.get()));
         conn->gattCharC1Handle = charHandle;
     }
-    else if (strcasecmp(uuid.get(), chip_ble_char_c2_rx_uuid) == 0)
+    else if (strcasecmp(uuid.get(), Ble::CHIP_BLE_CHAR_2_UUID_STR) == 0)
     {
         ChipLogProgress(DeviceLayer, "CHIP Char C2 RX Found [%s]", StringOrNullMarker(uuid.get()));
         conn->gattCharC2Handle = charHandle;
@@ -806,7 +799,7 @@
     VerifyOrExit(ret == BT_ERROR_NONE,
                  ChipLogError(DeviceLayer, "Failed to fetch GATT Attribute from SVC handle: %s", get_error_message(ret)));
 
-    if (strcasecmp(uuid.get(), chip_ble_service_uuid) == 0)
+    if (strcasecmp(uuid.get(), chip::Ble::CHIP_BLE_SERVICE_LONG_UUID_STR) == 0)
     {
         ChipLogProgress(DeviceLayer, "CHIP Service UUID Found [%s]", StringOrNullMarker(uuid.get()));
 
@@ -1142,36 +1135,21 @@
         }
         break;
     case DeviceEventType::kPlatformTizenBLEWriteComplete: {
-        Ble::ChipBleUUID service_uuid;
-        Ble::ChipBleUUID char_write_uuid;
-
-        StringToUUID(chip_ble_service_uuid, service_uuid);
-        StringToUUID(chip_ble_char_c1_tx_uuid, char_write_uuid);
-
-        HandleWriteConfirmation(apEvent->Platform.BLEWriteComplete.mConnection, &service_uuid, &char_write_uuid);
+        HandleWriteConfirmation(apEvent->Platform.BLEWriteComplete.mConnection, &Ble::CHIP_BLE_SVC_ID, &Ble::CHIP_BLE_CHAR_1_UUID);
         break;
     }
     case DeviceEventType::kPlatformTizenBLESubscribeOpComplete: {
-        Ble::ChipBleUUID service_uuid;
-        Ble::ChipBleUUID char_notif_uuid;
-
-        StringToUUID(chip_ble_service_uuid, service_uuid);
-        StringToUUID(chip_ble_char_c2_rx_uuid, char_notif_uuid);
-
         if (apEvent->Platform.BLESubscribeOpComplete.mIsSubscribed)
-            HandleSubscribeComplete(apEvent->Platform.BLESubscribeOpComplete.mConnection, &service_uuid, &char_notif_uuid);
+            HandleSubscribeComplete(apEvent->Platform.BLESubscribeOpComplete.mConnection, &Ble::CHIP_BLE_SVC_ID,
+                                    &chip::Ble::CHIP_BLE_CHAR_2_UUID);
         else
-            HandleUnsubscribeComplete(apEvent->Platform.BLESubscribeOpComplete.mConnection, &service_uuid, &char_notif_uuid);
+            HandleUnsubscribeComplete(apEvent->Platform.BLESubscribeOpComplete.mConnection, &Ble::CHIP_BLE_SVC_ID,
+                                      &chip::Ble::CHIP_BLE_CHAR_2_UUID);
         break;
     }
     case DeviceEventType::kPlatformTizenBLEIndicationReceived: {
-        Ble::ChipBleUUID service_uuid;
-        Ble::ChipBleUUID char_notif_uuid;
-
-        StringToUUID(chip_ble_service_uuid, service_uuid);
-        StringToUUID(chip_ble_char_c2_rx_uuid, char_notif_uuid);
-
-        HandleIndicationReceived(apEvent->Platform.BLEIndicationReceived.mConnection, &service_uuid, &char_notif_uuid,
+        HandleIndicationReceived(apEvent->Platform.BLEIndicationReceived.mConnection, &Ble::CHIP_BLE_SVC_ID,
+                                 &chip::Ble::CHIP_BLE_CHAR_2_UUID,
                                  System::PacketBufferHandle::Adopt(apEvent->Platform.BLEIndicationReceived.mData));
         break;
     }
@@ -1182,43 +1160,29 @@
 
 void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
 {
-    Ble::ChipBleUUID service_uuid;
-    Ble::ChipBleUUID char_notification_uuid;
-    Ble::ChipBleUUID char_write_uuid;
-
     switch (event->Type)
     {
     case DeviceEventType::kCHIPoBLESubscribe:
         ChipLogProgress(DeviceLayer, "CHIPoBLESubscribe");
 
-        StringToUUID(chip_ble_service_uuid, service_uuid);
-        StringToUUID(chip_ble_char_c2_rx_uuid, char_notification_uuid);
-
-        HandleSubscribeReceived(event->CHIPoBLESubscribe.ConId, &service_uuid, &char_notification_uuid);
+        HandleSubscribeReceived(event->CHIPoBLESubscribe.ConId, &Ble::CHIP_BLE_SVC_ID, &Ble::CHIP_BLE_CHAR_2_UUID);
         NotifyBLEConnectionEstablished(event->CHIPoBLESubscribe.ConId, CHIP_NO_ERROR);
         break;
     case DeviceEventType::kCHIPoBLEUnsubscribe:
         ChipLogProgress(DeviceLayer, "CHIPoBLEUnsubscribe");
 
-        StringToUUID(chip_ble_service_uuid, service_uuid);
-        StringToUUID(chip_ble_char_c2_rx_uuid, char_notification_uuid);
-
-        HandleUnsubscribeReceived(event->CHIPoBLESubscribe.ConId, &service_uuid, &char_notification_uuid);
+        HandleUnsubscribeReceived(event->CHIPoBLESubscribe.ConId, &Ble::CHIP_BLE_SVC_ID, &Ble::CHIP_BLE_CHAR_2_UUID);
         break;
     case DeviceEventType::kCHIPoBLEWriteReceived:
         ChipLogProgress(DeviceLayer, "CHIPoBLEWriteReceived");
 
-        StringToUUID(chip_ble_service_uuid, service_uuid);
-        StringToUUID(chip_ble_char_c1_tx_uuid, char_write_uuid);
-        HandleWriteReceived(event->CHIPoBLEWriteReceived.ConId, &service_uuid, &char_write_uuid,
+        HandleWriteReceived(event->CHIPoBLEWriteReceived.ConId, &Ble::CHIP_BLE_SVC_ID, &Ble::CHIP_BLE_CHAR_1_UUID,
                             System::PacketBufferHandle::Adopt(event->CHIPoBLEWriteReceived.Data));
         break;
     case DeviceEventType::kCHIPoBLEIndicateConfirm:
         ChipLogProgress(DeviceLayer, "CHIPoBLEIndicateConfirm");
 
-        StringToUUID(chip_ble_service_uuid, service_uuid);
-        StringToUUID(chip_ble_char_c2_rx_uuid, char_notification_uuid);
-        HandleIndicationConfirmation(event->CHIPoBLEIndicateConfirm.ConId, &service_uuid, &char_notification_uuid);
+        HandleIndicationConfirmation(event->CHIPoBLEIndicateConfirm.ConId, &Ble::CHIP_BLE_SVC_ID, &Ble::CHIP_BLE_CHAR_2_UUID);
         break;
     case DeviceEventType::kCHIPoBLEConnectionError:
         ChipLogProgress(DeviceLayer, "CHIPoBLEConnectionError");
@@ -1241,19 +1205,14 @@
 bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const Ble::ChipBleUUID * svcId,
                                              const Ble::ChipBleUUID * charId)
 {
-    Ble::ChipBleUUID service_uuid;
-    Ble::ChipBleUUID char_notif_uuid;
     int ret;
 
     ChipLogProgress(DeviceLayer, "SubscribeCharacteristic");
 
-    StringToUUID(chip_ble_service_uuid, service_uuid);
-    StringToUUID(chip_ble_char_c2_rx_uuid, char_notif_uuid);
-
     VerifyOrExit(conId != nullptr, ChipLogError(DeviceLayer, "Invalid Connection"));
-    VerifyOrExit(Ble::UUIDsMatch(svcId, &service_uuid),
+    VerifyOrExit(Ble::UUIDsMatch(svcId, &Ble::CHIP_BLE_SVC_ID),
                  ChipLogError(DeviceLayer, "SubscribeCharacteristic() called with invalid service ID"));
-    VerifyOrExit(Ble::UUIDsMatch(charId, &char_notif_uuid),
+    VerifyOrExit(Ble::UUIDsMatch(charId, &Ble::CHIP_BLE_CHAR_2_UUID),
                  ChipLogError(DeviceLayer, "SubscribeCharacteristic() called with invalid characteristic ID"));
     VerifyOrExit(conId->gattCharC2Handle != nullptr, ChipLogError(DeviceLayer, "Char C2 is null"));
 
@@ -1274,19 +1233,14 @@
 bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const Ble::ChipBleUUID * svcId,
                                                const Ble::ChipBleUUID * charId)
 {
-    Ble::ChipBleUUID service_uuid;
-    Ble::ChipBleUUID char_notif_uuid;
     int ret;
 
     ChipLogProgress(DeviceLayer, "UnSubscribeCharacteristic");
 
-    StringToUUID(chip_ble_service_uuid, service_uuid);
-    StringToUUID(chip_ble_char_c2_rx_uuid, char_notif_uuid);
-
     VerifyOrExit(conId != nullptr, ChipLogError(DeviceLayer, "Invalid Connection"));
-    VerifyOrExit(Ble::UUIDsMatch(svcId, &service_uuid),
+    VerifyOrExit(Ble::UUIDsMatch(svcId, &Ble::CHIP_BLE_SVC_ID),
                  ChipLogError(DeviceLayer, "UnSubscribeCharacteristic() called with invalid service ID"));
-    VerifyOrExit(Ble::UUIDsMatch(charId, &char_notif_uuid),
+    VerifyOrExit(Ble::UUIDsMatch(charId, &Ble::CHIP_BLE_CHAR_2_UUID),
                  ChipLogError(DeviceLayer, "UnSubscribeCharacteristic() called with invalid characteristic ID"));
     VerifyOrExit(conId->gattCharC2Handle != nullptr, ChipLogError(DeviceLayer, "Char C2 is null"));
 
@@ -1360,19 +1314,14 @@
 bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const Ble::ChipBleUUID * svcId, const Ble::ChipBleUUID * charId,
                                       System::PacketBufferHandle pBuf)
 {
-    Ble::ChipBleUUID service_uuid;
-    Ble::ChipBleUUID char_write_uuid;
     int ret;
 
     ChipLogProgress(DeviceLayer, "SendWriteRequest");
 
-    StringToUUID(chip_ble_service_uuid, service_uuid);
-    StringToUUID(chip_ble_char_c1_tx_uuid, char_write_uuid);
-
     VerifyOrExit(conId != nullptr, ChipLogError(DeviceLayer, "Invalid Connection"));
-    VerifyOrExit(Ble::UUIDsMatch(svcId, &service_uuid),
+    VerifyOrExit(Ble::UUIDsMatch(svcId, &Ble::CHIP_BLE_SVC_ID),
                  ChipLogError(DeviceLayer, "SendWriteRequest() called with invalid service ID"));
-    VerifyOrExit(Ble::UUIDsMatch(charId, &char_write_uuid),
+    VerifyOrExit(Ble::UUIDsMatch(charId, &Ble::CHIP_BLE_CHAR_1_UUID),
                  ChipLogError(DeviceLayer, "SendWriteRequest() called with invalid characteristic ID"));
     VerifyOrExit(conId->gattCharC1Handle != nullptr, ChipLogError(DeviceLayer, "Char C1 is null"));
 
@@ -1455,7 +1404,7 @@
     }
 
     /* Send StartChipScan Request to Scanner Class */
-    strcpy(data.service_uuid, chip_ble_service_uuid_short);
+    strcpy(data.service_uuid, Ble::CHIP_BLE_DESC_SHORT_UUID_STR);
     err = mDeviceScanner->StartChipScan(kNewConnectionScanTimeout, ScanFilterType::kServiceData, data);
     VerifyOrExit(err == CHIP_NO_ERROR, ChipLogError(DeviceLayer, "Failed to start BLE scan"));
 
diff --git a/src/platform/Tizen/ChipDeviceScanner.cpp b/src/platform/Tizen/ChipDeviceScanner.cpp
index aea5aab..2b022f5 100644
--- a/src/platform/Tizen/ChipDeviceScanner.cpp
+++ b/src/platform/Tizen/ChipDeviceScanner.cpp
@@ -30,6 +30,7 @@
 #include <bluetooth.h>
 #include <bluetooth_internal.h>
 
+#include <ble/BleUUID.h>
 #include <lib/support/CodeUtils.h>
 #include <lib/support/Span.h>
 #include <lib/support/logging/CHIPLogging.h>
@@ -40,10 +41,6 @@
 namespace DeviceLayer {
 namespace Internal {
 
-// CHIPoBLE UUID strings
-const char chip_service_uuid[]       = "0000FFF6-0000-1000-8000-00805F9B34FB";
-const char chip_service_uuid_short[] = "FFF6";
-
 ChipDeviceScanner::ChipDeviceScanner(ChipDeviceScannerDelegate * delegate) : mDelegate(delegate) {}
 
 ChipDeviceScanner::~ChipDeviceScanner()
@@ -100,8 +97,8 @@
     {
         for (int i = 0; i < count; i++)
         {
-            if (g_strcmp0(dataList[i].service_uuid, chip_service_uuid) == 0 ||
-                g_strcmp0(dataList[i].service_uuid, chip_service_uuid_short) == 0)
+            if (g_strcmp0(dataList[i].service_uuid, chip::Ble::CHIP_BLE_CHAR_1_UUID_STR) == 0 ||
+                g_strcmp0(dataList[i].service_uuid, chip::Ble::CHIP_BLE_SERVICE_SHORT_UUID_STR) == 0)
             {
                 ChipLogProgress(DeviceLayer, "CHIP Thing Device Found! [Service Data UUID] = %s", dataList[i].service_uuid);
                 // Print full Service Data
