]> git.itanic.dy.fi Git - log-plotter/commit
read_data: Handle the input data more gracefully
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 6 Oct 2013 19:25:04 +0000 (22:25 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 6 Oct 2013 19:46:14 +0000 (22:46 +0300)
commit3d8040b9815e450cec28cc26aa1d158fb02500ae
tree5ada6fc9e9bfcd567362b8cd8bd7aa0f1a1ca5b4
parent564f4d9d9c2cc16e53265c40ad63712cf14f534d
read_data: Handle the input data more gracefully

The serial port is giving the data to us very slowly, perhaps only a
few bytes a time. Therefore we need to take special care in order to
not handle incomplete log lines.

Add a new function to read one complete line of data from the
device. Once the complete line is read, write it to the logfile (if
one is open) and then also to the console.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
main.c