bpod_core.com.ChunkedSerialReader
- class bpod_core.com.ChunkedSerialReader 
 Bases:
ProtocolA protocol for reading chunked data from a serial port.
This class provides methods to buffer incoming data and retrieve it in chunks.
- __init__(chunk_size, callback, buffer=None) None 
 Initialize the protocol.
- Parameters:
 chunk_size (
int) – The fixed size of chunks to emit to the callback function when enough data has accumulated in the buffer.callback (
Callable) – A function to call with each chunk of data.buffer (
bytearray, optional) – Pre-allocated buffer to use for accumulation. If None, a new bytearray is created.
- Return type:
 None
- connection_lost(exc) None 
 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: