Utilities

Frame Stream

class aio_ld2410.stream.FrameStream[source]

Utility class used to produce frames out bytes.

__init__(initial_bytes: bytes = b'') None[source]

Create a new frame stream processor.

Parameters:

initial_bytes (bytes, default: b'') – initial bytes pushed to the internal buffer.

__iter__() Iterator[Container[Any]][source]

Iterate over full frames from the internal buffer.

Yields:

Frames received from the device.

Return type:

Iterator[Container[Any]]

push(data: bytes) int[source]

Push new received data to the stream.

Parameters:

data (bytes) – additional bytes to append.

Returns:

int – The number of bytes written to the internal buffer.