![]() |
|
| << Previous | Next >> | |
| | |
int serXread( void * data, int length, unsigned long tmout ); /* where X is A-F */
Description
- Reads
lengthbytes from serial port X or untiltmoutmilliseconds transpires between bytes. The countdown oftmoutdoes not begin until a byte has been received. A timeout occurs immediately if there are no characters to read. This function is non-reentrant.
- The functions
serEread()andserFread()may be used with the Rabbit 3000 and Rabbit 4000.Parameters
- data
- Data structure to read from serial port X
- length
- Number of bytes to read
- tmout
- Maximum wait in milliseconds for any byte from previous one
Return value
- The number of bytes read from serial port X.
Library
- RS232.LIB
Example
// echoes a blocks of characters
main() {
int n;
char s[16];
serAopen(19200);
while (1) {
if ((n = serAread(s, 15, 20)) > 0) {
serAwrite(s, n);
}
}
serAclose();
}
| Dynamic C Functions | << Previous | Next >> | rabbit.com |