JemuUart

class jumper.jemu_uart.JemuUart(uart_device_path, vlab)

Represents a UART device.

read()
Returns:data available on the UART device. Returns an empty bytes string if no data is available.
read_line(line_separator='\r\n')

Reads a single line from UART.

Parameters:line_separator – Substring for separating lines. Usually b’\r\n’ or b’\n’
Returns:A byte string of data read from the device, including line_separator
wait_until_uart_receives(data, timeout=None)

Blocks until specified data is received on UART. If the device is paused, this function will continue the execution and will pause the device when the data is ready or timeout occured. If the device is running, the function will not pause the device.

Parameters:
  • data – Expected bytes string.
  • timeout – Emulation time specified in milliseconds. jumper.vlab.TimeoutException is raised if timeout occurred before data was available in the buffer.
Returns:

The data available on in the UART buffer when the specified data was received. Note that this can be more than the data provided in the data parameter.

write(data)

Writes data to UART

Parameters:data – Data to write