aboutsummaryrefslogtreecommitdiff
path: root/apps/sm-serial-read-all.h
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-07-19 20:02:00 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2015-07-19 20:02:00 +0200
commit0374af511d7efdb856af372f126e66e5a78841d7 (patch)
treeb63444108dbccf7ce1ddd3c0bb8ab9ac4f1aebaa /apps/sm-serial-read-all.h
parentbfcc6e18af33d21ae3ae23def873fa6415045bec (diff)
downloadble-toys-0374af511d7efdb856af372f126e66e5a78841d7.tar.gz
ble-toys-0374af511d7efdb856af372f126e66e5a78841d7.tar.bz2
ble-toys-0374af511d7efdb856af372f126e66e5a78841d7.tar.xz
ble-toys-0374af511d7efdb856af372f126e66e5a78841d7.zip
o Applying clang-format to all apps.
Diffstat (limited to 'apps/sm-serial-read-all.h')
-rw-r--r--apps/sm-serial-read-all.h21
1 files changed, 9 insertions, 12 deletions
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<SampleStreamParser> parser) :
- port_name(port_name), port(port), parser(move(parser)) {
+ port_handler(string &port_name, serial_port &port, unique_ptr<SampleStreamParser> parser)
+ : port_name(port_name), port(port), parser(move(parser)) {
}
void run() {
@@ -54,7 +54,6 @@ private:
unique_ptr<SampleStreamParser> parser;
};
-
}
// This only supports Linux
@@ -65,7 +64,7 @@ private:
vector<string> &&find_ports() {
DIR *dir = opendir("/dev");
- vector <string> ports;
+ vector<string> 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<string>()->required(), "The serial port to read")
- ("format", po::value<sample_format_type>(&format)->default_value(sample_format_type::KEY_VALUE), "Output format");
+ options("port", po::value<string>()->required(), "The serial port to read");
+ options("format", po::value<sample_format_type>(&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<SampleStreamParser> parser = open_sample_stream_parser(thread_safe_output, parserDict, sample_format_type::KEY_VALUE);
+ unique_ptr<SampleStreamParser> 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;
}
-
};
-
}
}