Skip to content

Receiving Data

WillB97 edited this page Jun 27, 2017 · 1 revision
poll_COM_port(/*buffer*/, /*length*/)
Buffer
A buffer to store the received data in. This must be a buffer and not a pointer as the function does not allocate memory so will fail if there is not available memory at the address.
Length
The maximum number of bytes to put in the buffer, this must be less than or equal to the size of the buffer.
The function returns the number of bytes received on success and on error a negative error code. As the read function does not wait for data be received this actually just retrieves data from the operating system's buffer.