User`s manual

20 RabbitCore 2000
3.3.2 Non-Cofunction Blocking Input Functions
These are simple functions that do not use Dynamic C costatements. If no input data are
available when called, they return immediately with appropriate status information in their
return value. Once they begin to receive characters, they do not yield to other tasks until
they complete their operation or until a character-to-character time-out period elapses.
int serXgetc ( );
Gets a single character. Always returns immediately, either with the next available input byte, or with 1
if none is available.
Parameters
None
Return Value
An integer with return character in the low byte. No character is represented by a return of 1.
int serXread (void *data, int length, unsigned long tmout);
Reads a block of characters. Returns the number of bytes read from an input serial stream. The stream is
considered to be ended when all
length bytes have been read or when the timeout period elapses wait-
ing for data to appear in the input buffer.
Parameters
dataDestination data structure. The user must ensure data is allocated for at least length bytes.
lengthThe number of bytes to read.
tmoutThe number of milliseconds to wait for receipt of each byte before timing out.
Return Value
The number of bytes read into data until timed out or until all length bytes have been read.