serial_dashboard.comms.read_all_newlines

serial_dashboard.comms.read_all_newlines(ser, read_buffer=b'', n_reads=1)

Read data in until encountering newlines.

Parameters
  • ser (serial.Serial() instance) – The device we are reading from.

  • n_reads (int) – The number of reads up to newlines

  • read_buffer (bytes, default b'') – Previous read buffer that is appended to.

Returns

output – Bytes object that contains read_buffer + read.

Return type

bytes

Notes