Skip to content

Commit

Permalink
Fix BTAdvertisedDeviceSet::toString() method output
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed Oct 3, 2023
1 parent 099b432 commit 88b6544
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ bool BTAdvertisedDeviceSet::haveRSSI() const { return m_haveRSSI; }
std::string BTAdvertisedDeviceSet::toString() {
std::string res = "Name: " + getName() + ", Address: " + std::string(getAddress().toString().c_str(), getAddress().toString().length());
if (haveCOD()) {
char val[6];
snprintf(val, sizeof(val), "%d", getCOD());
res += ", cod: ";
char val[7]; //6 hex digits + null
snprintf(val, sizeof(val), "%06x", getCOD() & 0xFFFFFF);
res += ", cod: 0x";
res += val;
}
if (haveRSSI()) {
Expand Down

0 comments on commit 88b6544

Please sign in to comment.