retain telemetry across transport outages
This commit is contained in:
@@ -16,6 +16,7 @@ MAX_RECORDS = 8
|
||||
|
||||
PACKET_TYPE_METADATA = 1
|
||||
PACKET_TYPE_SAMPLES = 2
|
||||
PACKET_FLAG_TIMESTAMP_DELTA_SATURATED = 0x01
|
||||
|
||||
HEADER = struct.Struct("<4sBBBBBBHIQIII")
|
||||
METADATA = struct.Struct("<HHHH10f")
|
||||
@@ -127,6 +128,11 @@ class StreamParser:
|
||||
self.startup_crc_errors = 0
|
||||
self.crc_errors = 0
|
||||
|
||||
@property
|
||||
def buffered_bytes(self) -> int:
|
||||
"""Bytes retained because they do not yet form a complete frame."""
|
||||
return len(self._buffer)
|
||||
|
||||
def feed(self, data: bytes) -> list[Frame]:
|
||||
self._buffer.extend(data)
|
||||
frames: list[Frame] = []
|
||||
|
||||
Reference in New Issue
Block a user