diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/apps.cpp | 11 | ||||
-rw-r--r-- | apps/ble-inspect-device.cpp | 3 | ||||
-rw-r--r-- | apps/ble-read-characteristic.cpp | 2 |
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; |