aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-03-04 22:51:26 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-03-04 22:51:26 +0100
commit4fa6e39b7e74761dc54b6203cd05c8d5b89cb7c8 (patch)
tree6888ef2fe287bdc79d06660fb95fe330919c290e /apps
parentf89ec560be3436050f7f55eec1da4a40662c0de8 (diff)
downloadble-toys-4fa6e39b7e74761dc54b6203cd05c8d5b89cb7c8.tar.gz
ble-toys-4fa6e39b7e74761dc54b6203cd05c8d5b89cb7c8.tar.bz2
ble-toys-4fa6e39b7e74761dc54b6203cd05c8d5b89cb7c8.tar.xz
ble-toys-4fa6e39b7e74761dc54b6203cd05c8d5b89cb7c8.zip
o Only sending the data to cout, the rest goes to cerr.
Diffstat (limited to 'apps')
-rw-r--r--apps/sm-serial-read.cpp8
1 files 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<vector<uint8_t>> packet) {
// std::chrono::time_point<std::chrono::system_clock> ;
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();