aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-11-23 16:41:24 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2018-11-23 16:41:24 +0100
commitaf416f81b14a3bee682e300b165a6efdb9739d54 (patch)
tree20c4704d5d24ed18a78970f9331aec12c9522a41 /apps
parent2034b1bb10720a2f0e6cc97427346f2320c115bc (diff)
downloadble-toys-af416f81b14a3bee682e300b165a6efdb9739d54.tar.gz
ble-toys-af416f81b14a3bee682e300b165a6efdb9739d54.tar.bz2
ble-toys-af416f81b14a3bee682e300b165a6efdb9739d54.tar.xz
ble-toys-af416f81b14a3bee682e300b165a6efdb9739d54.zip
o Trying to improve compatibility with some feature checks.
o Misc nits.
Diffstat (limited to 'apps')
-rw-r--r--apps/apps.cpp11
-rw-r--r--apps/ble-inspect-device.cpp3
-rw-r--r--apps/ble-read-characteristic.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/apps/apps.cpp b/apps/apps.cpp
index 56abc7b..ef0a7fc 100644
--- a/apps/apps.cpp
+++ b/apps/apps.cpp
@@ -53,12 +53,12 @@ const po::options_description logging_options() {
return desc;
}
-void setup_logging(string app_name) {
+void setup_logging(const string &app_name) {
Appender *console = new ConsoleAppender(true, true);
string pattern = "%-5p %D{%Y-%m-%d %H:%M:%S} " + app_name + "/%-20c %m%n"; // add %M (function name)
- PatternLayout *layout = new PatternLayout(LOG4CPLUS_TEXT(pattern));
+ auto *layout = new PatternLayout(LOG4CPLUS_TEXT(pattern));
console->setLayout(auto_ptr<Layout>(layout));
Hierarchy &h = Logger::getDefaultHierarchy();
@@ -90,7 +90,7 @@ int launch_app(app *app, int argc, const char *argv[]) {
return EXIT_FAILURE;
}
- if (unrecognized.size()) {
+ if (!unrecognized.empty()) {
cerr << "Unrecognized option: " << unrecognized.at(0) << "\n";
return EXIT_FAILURE;
}
@@ -123,5 +123,6 @@ int real_main(app *app, int argc, const char *argv[]) {
return launch_app(app, argc, argv);
}
-}
-}
+
+} // namespace apps
+} // namespace trygvis
diff --git a/apps/ble-inspect-device.cpp b/apps/ble-inspect-device.cpp
index a6665b3..cb8cf0f 100644
--- a/apps/ble-inspect-device.cpp
+++ b/apps/ble-inspect-device.cpp
@@ -44,8 +44,7 @@ public:
<< endl;
for (auto &c : characteristics) {
- cout << "Characteristic: UUID: " << c->getUuid() << ", properties: " << (uint16_t) c->getProperties()
- << endl;
+ cout << "Characteristic: UUID: " << c->getUuid() << ", properties: " << (uint16_t) c->getProperties() << endl;
}
}
}
diff --git a/apps/ble-read-characteristic.cpp b/apps/ble-read-characteristic.cpp
index ecdb471..3ef3c70 100644
--- a/apps/ble-read-characteristic.cpp
+++ b/apps/ble-read-characteristic.cpp
@@ -117,7 +117,7 @@ public:
} while(std::chrono::system_clock::now() < end);
}
} else {
- cout << "Unsupported op mode." << endl;
+ cout << "Unsupported op mode: " << op_mode << endl;
}
return EXIT_SUCCESS;