From af416f81b14a3bee682e300b165a6efdb9739d54 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 23 Nov 2018 16:41:24 +0100 Subject: o Trying to improve compatibility with some feature checks. o Misc nits. --- apps/apps.cpp | 11 ++++++----- apps/ble-inspect-device.cpp | 3 +-- apps/ble-read-characteristic.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'apps') 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)); 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; -- cgit v1.2.3