Using Streams: 1.6 Using Streams: The Basics: Miscellaneous Functions

Up: GEOS SDK TechDocs | Up | Prev: 1.5 Shutting Down a Stream | Next: 2 Using the Serial Ports
StreamFlush(), StreamQuery()

To flush all the pending (written but unread) data from a stream, call the routine StreamFlush() . This routine is passed two arguments:

To find out how much free space is available in a stream, or how much data is waiting to be read, call StreamQuery() . This routine is passed four arguments:

If the call is successful, StreamQuery() returns zero and writes its return value to the fourth argument. If you pass STREAM_ROLES_WRITER, StreamQuery() writes the number of bytes of free space available in the stream buffer. If you pass STREAM_ROLES_READER, StreamQuery() returns the number of bytes of data waiting to be read. If the call is unsuccessful, StreamQuery() returns a StreamError .


Up: GEOS SDK TechDocs | Up | Prev: 1.5 Shutting Down a Stream | Next: 2 Using the Serial Ports