From 4fa6e39b7e74761dc54b6203cd05c8d5b89cb7c8 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 4 Mar 2015 22:51:26 +0100 Subject: o Only sending the data to cout, the rest goes to cerr. --- apps/sm-serial-read.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/sm-serial-read.cpp b/apps/sm-serial-read.cpp index 4dab17b..ff311a1 100644 --- a/apps/sm-serial-read.cpp +++ b/apps/sm-serial-read.cpp @@ -79,14 +79,14 @@ public: } } - cout << "port closed" << endl; + cerr << "port closed" << endl; } void on_packet(shared_ptr> packet) { // std::chrono::time_point ; auto timestamp = std::chrono::system_clock::now().time_since_epoch().count(); auto s = std::string((char *) packet->data(), packet->size()); - cout << "packet: " << s << endl; + cerr << "packet: " << s << endl; static const boost::regex e("#(\\d+) = (\\d+)"); @@ -165,9 +165,9 @@ public: port.set_option(serial_port_base::stop_bits(serial_port_base::stop_bits::two)); if (port.is_open()) { - cout << "port is open" << endl; + cerr << "port is open" << endl; } else { - cout << "port is not open" << endl; + cerr << "port is not open" << endl; } port_handler(format, port_name, port).run(); -- cgit v1.2.3