Reputation: 307
In C/C++
How can I read from serial port, without removing the info I have already read from the buffer?
I want to do something like the Peek function of arduino (http://arduino.cc/en/Serial/Peek) in a linux machine.
Upvotes: 0
Views: 2605
Reputation: 6647
The serial port is accessed as though it is a file using a file descriptor so a fgetc ungetc method should work.
Upvotes: 1