Page 1 of 1

ClrDataAvail( ) usage

Posted: Tue Jul 18, 2017 1:51 pm
by vsabino
Hi,

What is the proper use of this function? I tried to find documentation for it, but was unsuccessful.
I'm trying to clear the contents of the read buffer before I expect real data to be there.

Thanks,
Victor

Re: ClrDataAvail( ) usage

Posted: Wed Jul 19, 2017 10:10 am
by TomNB
I would use dataavail(fd) in a loop until all data is read from the buffer.

Re: ClrDataAvail( ) usage

Posted: Sun Jul 23, 2017 6:02 am
by pbreed
ClearDataAvail is used at the internal driver level when the last byte of data has been read.
It has no effect on the buffer....