Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7b4d468

Browse filesBrowse files
authored
Fix BTAdvertisedDeviceSet::toString() method output (espressif#8691)
1 parent 2d6d285 commit 7b4d468
Copy full SHA for 7b4d468

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp

Copy file name to clipboardExpand all lines: libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ bool BTAdvertisedDeviceSet::haveRSSI() const { return m_haveRSSI; }
4141
std::string BTAdvertisedDeviceSet::toString() {
4242
std::string res = "Name: " + getName() + ", Address: " + std::string(getAddress().toString().c_str(), getAddress().toString().length());
4343
if (haveCOD()) {
44-
char val[6];
45-
snprintf(val, sizeof(val), "%d", getCOD());
46-
res += ", cod: ";
44+
char val[7]; //6 hex digits + null
45+
snprintf(val, sizeof(val), "%06x", getCOD() & 0xFFFFFF);
46+
res += ", cod: 0x";
4747
res += val;
4848
}
4949
if (haveRSSI()) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.