Function rc_uart_read_line#
- Defined in File uart.h 
Function Documentation#
- 
int rc_uart_read_line(int bus, uint8_t *buf, size_t max_bytes)#
- reads a line of characters ending in newline ‘ - ’ - This is a blocking function call. It will only return on these conditions: - a newline character was read, this is discarded. 
- max_bytes were read, this prevents overflowing a user buffer. 
- timeout declared in rc_uart_init() is reached 
- shutdown flag is set by rc_uart_close 
 - Parameters:
- bus – [in] The bus number /dev/ttyO{bus} 
- buf – [out] data pointer 
- max_bytes – [in] max bytes to read in case newline character not found 
 
- Returns:
- Returns number of bytes actually read or -1 on error.