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 947ee6f

Browse filesBrowse files
authored
refactor(toString method): Add RSSI / serviceData (espressif#7561)
* refactor(toString method): Add RSSI / serviceData These are key characteristics of the BLE advertising packet. Really useful, adding to this method allows data to be easily obtained and passed over TCP/IP for processing. * fix: remove line 565 bug
1 parent d08e900 commit 947ee6f
Copy full SHA for 947ee6f

File tree

Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed

‎libraries/BLE/src/BLEAdvertisedDevice.cpp

Copy file name to clipboardExpand all lines: libraries/BLE/src/BLEAdvertisedDevice.cpp
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,17 @@ std::string BLEAdvertisedDevice::toString() {
560560
res += ", txPower: ";
561561
res += val;
562562
}
563+
if (haveRSSI()) {
564+
char val[4];
565+
snprintf(val, sizeof(val), "%i", getRSSI());
566+
res += ", rssi: ";
567+
res += val;
568+
}
569+
if (haveServiceData()) {
570+
for (int i=0; i <getServiceDataCount(); i++) {
571+
res += ", serviceData: " + getServiceData(i);
572+
}
573+
}
563574
return res;
564575
} // toString
565576

0 commit comments

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