Using the QuickUSB Library
QuickUsbFlushRS232
Purpose
Flush the RS232 port transmit and receive buffers.
Parameters
hDevice: A HANDLE that was returned from a call to QuickUsbOpen.
portNum: The serial port number. Serial port 0 (P1) = 0, serial port 1 (P2)
= 1.
Returns
A non-zero value if successful, 0 otherwise.
Notes
None.
QuickUsbReadRS232
Purpose
Read a block of characters from the interrupt receive buffer of the
specified QuickUSB serial port.
Parameters
hDevice: A HANDLE that was returned from a call to QuickUsbOpen.
portNum: The serial port number. Serial port 0 (P1) = 0, serial port 1 (P2)
= 1.
data:
A pointer to a buffer in which to place the data. The buffer must
be at least 128 bytes long.
length: A pointer to the number of characters to read. Set to the
number of characters actually read on return.
Returns
A non-zero value, the data and the length if successful, 0 otherwise.
Notes
•
The interrupt buffer is 128 bytes deep. If length is set to more than
128, the routine will hang and wait for the specified number of
characters to be read from the port before returning.
RS-232
65