Serial Library (1.21) - how to receive data NON Async?

Vader

Well-Known Member
Licensed User
Longtime User
Hi,

I am porting an application from Windows, and in that application, I prefer NOT to read and send asynchronously. I want to control explicitly when to read and write to the serial port.

I can also tell the remote device to stop sending data, and at that time I flush all un-read data from the Serial Port.

So, my 2 questions are:
1
(a). How do I read data when I want (with blocking calls that I can set a TIMEOUT), and (if appropriate)
(b) send data when I want?
2. How do I flush all waiting data from the serial port?

Thanks

Dave
 

Vader

Well-Known Member
Licensed User
Longtime User
All network operations are done in the background. Otherwise you will get the "application not responding" error.

:(

I really didn't want to have to worry about Async reads. The last time I did this (on Windows), I had to worry about the UI thread being different to the read thread, and I kept on dropping bytes. It was horrible.

[BIG Sigh] I guess I don't have a choice.

Thanks for answering my question Erel.
 
Upvote 0
Top