ClrDataAvail( ) usage

Discussion to talk about software related topics only.
Post Reply
vsabino
Posts: 32
Joined: Wed May 14, 2008 8:45 am

ClrDataAvail( ) usage

Post 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
User avatar
TomNB
Posts: 569
Joined: Tue May 10, 2016 8:22 am

Re: ClrDataAvail( ) usage

Post by TomNB »

I would use dataavail(fd) in a loop until all data is read from the buffer.
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: ClrDataAvail( ) usage

Post 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....
Post Reply