8000 Merge remote-tracking branch 'upstream/master' · tsaitsai/esp32-snippets@b3d337b · GitHub
[go: up one dir, main page]

Skip to content

Commit b3d337b

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 2916e6c + 1d8dfbe commit b3d337b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

cpp_utils/BLEScan.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,17 @@ void BLEScan::stop() {
228228
} // stop
229229

230230

231+
/**
232+
* @brief Dump the scan results to the log.
233+
*/
234+
void BLEScanResults::dump() {
235+
ESP_LOGD(LOG_TAG, ">> Dump scan results:");
236+
for (int i=0; i<getCount(); i++) {
237+
ESP_LOGD(LOG_TAG, "- %s", getDevice(i).toString().c_str());
238+
}
239+
} // dump
240+
241+
231242
/**
232243
* @brief Return the count of devices found in the last scan.
233244
* @return The number of devices found in the last scan.
@@ -247,4 +258,5 @@ BLEAdvertisedDevice BLEScanResults::getDevice(uint32_t i) {
247258
return m_vectorAdvertisedDevices.at(i);
248259
}
249260

261+
250262
#endif /* CONFIG_BT_ENABLED */

cpp_utils/BLEScan.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class BLEScan;
3131
*/
3232
class BLEScanResults {
3333
public:
34+
void dump();
3435
int getCount();
3536
BLEAdvertisedDevice getDevice(uint32_t i);
3637

0 commit comments

Comments
 (0)
0