-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
SerialStream eats up feed characters 0x0A, 0x0D, and 0x0F when reading #162
Comments
@JacekRuzyczka Some sample code will surely help but I am guessing that you may be attempting to read data using |
@crayzeewulf I'm already using the operator, just like this:
|
@JacekRuzyczka The use of
tmc_receiver_handler >> std::noskipws >> c;
c = tmc_receiver_handler.get() ; |
Your proposal worked immediately. Thank you!
|
Great to hear that! Thanks for letting us know. And, yes, |
When communicating with a serial-over-USB device (a GNS FM9 receiver for traffic messages) using a
SerialStream
object, I found out that not all characters coming from the device are in fact being read. This is what I always get served:3F 00 56 08 37 3F
When using the same device with the RDS Surveyor app (which is written in Java and uses a
com.fazecast.jSerialComm.SerialPort)
, the response looks like this:3F 00 00 56 08 0A 37 0C 0D 3F
After some research I stumbled over this posting: Wrong newline character over serial port (CR instead of LF). The poster does not use
libserial
, but his issue is exactly the same as mine.This is the system-side config of the port in question:
pi@autoradio:~ $ stty -a speed 38400 baud; rows 40; columns 80; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0; -parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff -iuclc -ixany -imaxbel iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc
The system is a Raspbery Pi 3B with the latest production version of Raspbian running.
Now, my question is: How can I make my
SerialStream
read all characters without any transformations, just as they come from the port? I don't really wanna usestty
because its settings might get overwritten when removing and reattaching the device. Thank you.NOTE: If necessary, I can post the code in question, but it's quite long.
The text was updated successfully, but these errors were encountered: