Function rc_uart_read_bytes#
Defined in File uart.h
Function Documentation#
-
int rc_uart_read_bytes(int bus, uint8_t *buf, size_t bytes)#
reads bytes from the UART bus
This is a blocking function call. It will only return once the desired number of bytes has been read from the buffer or the shutdown flag is set. due to the Sitara’s UART FIFO buffer, MAX_READ_LEN (128bytes) is the largest packet that can be read with a single call to read(). For reads larger than 128bytes, we run a loop instead.
- Parameters:
bus – [in] The bus number /dev/ttyO{bus}
buf – [out] data pointer
bytes – [in] number of bytes to read
- Returns:
Returns number of bytes actually read or -1 on error.