BinaryTraceFileReader¶
- class osi_utilities.tracefile.binary_reader.BinaryTraceFileReader(message_type=MessageType.UNKNOWN)[source]¶
Bases:
TraceFileReaderReader for single-channel binary OSI trace files (.osi).
Each message is stored as: [4-byte LE length][serialized protobuf bytes]
The message type can be specified explicitly or inferred from the filename.
- Parameters:
message_type (MessageType)
- open_with_type(path, message_type)[source]¶
Open a binary .osi trace file with an explicit message type.
- Parameters:
path (Path) – Path to the .osi file.
message_type (MessageType) – The message type to use.
- Returns:
True on success, False on failure.
- Return type:
- read_message()[source]¶
Read the next message from the binary trace file.
- Returns:
ReadResult on success, None if no more messages.
- Raises:
RuntimeError – If the message is truncated or deserialization fails.
- Return type:
ReadResult | None
- property message_type: MessageType¶
The message type being read.