Click to See Complete Forum and Search --> : Serial Port gets caught in loop


delbert Harry
April 16th, 1999, 04:26 PM
I have developed a class that access the serial ports of a PC. I have one problem though. If I am reading the buffer and I come to the end of the text the app waits until it finds a return character. Is there a way to use the CreateFile and Readfile functions so that you can detect the end of file?

April 19th, 1999, 06:38 AM
As I understood the problem you want to read data from serial port until there are any without having any particular character that indicates the end of data?
If so you can use ReadFile to read a certain number of bytes and then check if the specified number of bytes are read or the specified timeout occurs(which must be set)what would mean that there are no more data.

I hope it help...