retain telemetry across transport outages

This commit is contained in:
Jay
2026-08-17 14:00:14 -04:00
parent bc4a2856e1
commit 291c6b54e6
11 changed files with 222 additions and 37 deletions
+6
View File
@@ -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] = []