Skip to content

Commit 71e3d51

Browse files
tanakamasayukime-no-dev
authored andcommitted
Fix BLEUUID toString (#3289)
uuid16 is Missing first 4 characters. uuid is Missing last 2 characters.
1 parent 64cfb33 commit 71e3d51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/BLE/src/BLEUUID.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ std::string BLEUUID::toString() {
352352
// If the UUIDs are 16 or 32 bit, pad correctly.
353353

354354
if (m_uuid.len == ESP_UUID_LEN_16) { // If the UUID is 16bit, pad correctly.
355-
char hex[5];
356-
snprintf(hex, sizeof(hex), "%04x", m_uuid.uuid.uuid16);
355+
char hex[9];
356+
snprintf(hex, sizeof(hex), "%08x", m_uuid.uuid.uuid16);
357357
return std::string(hex) + "-0000-1000-8000-00805f9b34fb";
358358
} // End 16bit UUID
359359

0 commit comments

Comments
 (0)