ComReceiveBytes
ComReceiveBytes copies received data to application.
This non-blocking function attempts to copy any received data from internal communication port buffers into an application's buffer. If no data is available when this call is made, a zero is returned in the short integer specified by the pointer DataLenP.
Note that since System Manager calls can have significant overhead, it is advisable for the application to perform some level of local buffering and not perform character-at-a-time reads from the port's internal buffers.
- Syntax: err_t far ComReceiveBytes(handle_t Handle, char far *DataP,
int far *DataLenP)
- Parameters: handle_t Handle - The handle returned via a successful ComOpen.
char far *DataP - Far pointer to the application's data buffer
int far *DataLenP - This is a Far pointer to an integer which, on entry,
specifies the maximum number of data bytes to read.
On exit, this variable is set to the actual number of
bytes placed into the application's buffer.
- Returns: 0 - if successful
Any other value indicates an error condition.
ENOTYOURS - The specified port has not been acquired by the calling
application.
- Comments: ComOpen() must first be called in order to get a valid handle to the
communications port.