From 0374af511d7efdb856af372f126e66e5a78841d7 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 19 Jul 2015 20:02:00 +0200 Subject: o Applying clang-format to all apps. --- apps/sm-serial-read-all.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'apps/sm-serial-read-all.h') diff --git a/apps/sm-serial-read-all.h b/apps/sm-serial-read-all.h index 14cdf1e..b87727b 100644 --- a/apps/sm-serial-read-all.h +++ b/apps/sm-serial-read-all.h @@ -21,8 +21,8 @@ namespace sm_serial_read_all_utils { class port_handler { public: - port_handler(string &port_name, serial_port &port, unique_ptr parser) : - port_name(port_name), port(port), parser(move(parser)) { + port_handler(string &port_name, serial_port &port, unique_ptr parser) + : port_name(port_name), port(port), parser(move(parser)) { } void run() { @@ -54,7 +54,6 @@ private: unique_ptr parser; }; - } // This only supports Linux @@ -65,7 +64,7 @@ private: vector &&find_ports() { DIR *dir = opendir("/dev"); - vector ports; + vector ports; if (!dir) { return move(ports); @@ -100,13 +99,12 @@ public: sample_format_type format; void add_options(po::options_description_easy_init &options) override { - options - ("port", po::value()->required(), "The serial port to read") - ("format", po::value(&format)->default_value(sample_format_type::KEY_VALUE), "Output format"); + options("port", po::value()->required(), "The serial port to read"); + options("format", po::value(&format)->default_value(sample_format_type::KEY_VALUE), + "Output format"); } - static - void handler_thread(port_handler *handler) { + static void handler_thread(port_handler *handler) { handler->run(); } @@ -150,7 +148,8 @@ public: port.set_option(serial_port_base::flow_control(serial_port_base::flow_control::none)); KeyDictionary parserDict; // TODO: dette feiler - unique_ptr parser = open_sample_stream_parser(thread_safe_output, parserDict, sample_format_type::KEY_VALUE); + unique_ptr parser = + open_sample_stream_parser(thread_safe_output, parserDict, sample_format_type::KEY_VALUE); auto handler = new port_handler(port_name, port, move(parser)); active_ports[port_name] = handler; @@ -163,8 +162,6 @@ public: return EXIT_SUCCESS; } - }; - } } -- cgit v1.2.3