Go Down

Topic: Re-implementing serial monitor (serial read) C++ (Read 4408 times) previous topic - next topic


C++, I'm using a PC with window 7 OS, and netbean or QT creator with the minGW compiler set.



So am I right in thinking there is no simple way to only call a read byte function when a byte is present in the buffer to be read?


I looked at the SerialPort documentation for C#, and I don't see a method of determining whether there is data to read, or not.

On the other hand, the derivation path for SerialPort makes it just another stream reader, and stream readers know to stop when the stream is empty. There might be an eof() function somewhere in it's derivation path that you could use to see if you are at the end of the stream.

If you use a thread to read the port, it doesn't matter that the thread blocks waiting for data.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131