aboutsummaryrefslogtreecommitdiff
path: root/apps/ble-scan.cpp
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-12-20 08:35:51 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2018-12-20 08:35:51 +0100
commitffa313e80a27005405334db6491075442f6e1abd (patch)
tree23a48c91cfc0810afe88cc6104d0667516fbd4a9 /apps/ble-scan.cpp
parentaf416f81b14a3bee682e300b165a6efdb9739d54 (diff)
downloadble-toys-master.tar.gz
ble-toys-master.tar.bz2
ble-toys-master.tar.xz
ble-toys-master.zip
o Using more natural byte ordering in the code. No external effect. o Using global ==, != and < operators instead of in-class operators for better compatibility with STL. ByteBuffer: o Renaming setPosition() to setCursor().
Diffstat (limited to 'apps/ble-scan.cpp')
-rw-r--r--apps/ble-scan.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/ble-scan.cpp b/apps/ble-scan.cpp
index b148752..6d271da 100644
--- a/apps/ble-scan.cpp
+++ b/apps/ble-scan.cpp
@@ -64,7 +64,11 @@ public:
cout << "Stopped. Found " << seen_devices.size() << " devices." << endl;
- for_each(begin(seen_devices), end(seen_devices), [&](auto mac) { cout << mac.str() << endl; });
+ vector<Mac> devices(seen_devices.cbegin(), seen_devices.cend());
+ std::sort(devices.begin(), devices.end(), [](const Mac& a, const Mac& b) {
+ return a < b;
+ });
+ for_each(begin(devices), end(devices), [&](auto mac) { cout << " " << mac.str() << endl; });
return EXIT_SUCCESS;
} catch (std::runtime_error &ex) {