I am having a hard time trying to talk with my Arduino on a Debian system. I am a linux noob. It seems that these unix/linux systems are holding on to their serial terminals tight. Every option in the termios struct is about using serial ports with a terminal (like VT100 or something). I seriously doubt there's such usage nowadays. Trying to use a serial port for unbuffered and un-processed data is just so hard. I just learned today that by turning off flow control, I was finally able to send bytes from Debian PC to Arduino. The Arduino -> Debian worked out of the box.
I wonder if there exists a c/c++ library for linux to run Arduino fashion Serial ports, such as Serial.begin, available, read, write. I am just hacking up code I found online and hoping it will hold together.
Here is what I found, from a member on the beagle board forum (probably also on pi forum):https://github.com/KurtE/Raspberry_Pi/blob/master/library/WrapperSerial.cpp
I really can't understand why a FILE pointer is used and why one needs to open the serial port with open and then use the file descriptor to fopen again and only fread and fwrite with the FILE pointer instead of read and write with the file descriptor. I was using the file descriptor and it worked fine. Looks like the code disables buffering on FILE object so isn't that becoming just read and write?