ChunkedSerialReader

class bpod_core.com.ChunkedSerialReader

Bases: Protocol

A protocol for reading chunked data from a serial port.

This class provides methods to buffer incoming data and retrieve it in chunks.

connection_lost(exc)

Called when the serial port is closed or the reader loop terminated otherwise.

Parameters:

exc (BaseException, optional) – The exception that caused the connection to be closed, if any.

Return type:

None

connection_made(transport)

Called when a connection is made.

Parameters:

transport (ReaderThread) – The reader thread that created this protocol instance.

Return type:

None

data_received(data)

Called with snippets received from the serial port.

Parameters:

data (bytes) – The binary data received from the serial port.

Return type:

None