ProtobufTextFormatTraceReader¶
- class osi_utilities.tracefile.readers.textformat.ProtobufTextFormatTraceReader[source]¶
Bases:
TraceReaderReader for text human-readable OSI trace files (.txth).
Deprecated since version 0.3.0: The
.txthtext format is not reliably deserializable. The OSI specification states that it is “not unambiguously deserializable” — protobuf text format output is not guaranteed to be stable across library versions, field ordering may change, and float/double precision varies. Round-tripping (write then read) can silently lose data. Prefer.osi(binary) for single-channel or.mcapfor multi-channel trace files.Messages are stored in Google protobuf TextFormat. Each message is delimited by reading until the text can be parsed as a complete message.
See the Protocol Buffers Text Format Language Specification.
- set_message_type(message_type)[source]¶
Set message type to be used on open().
Pass
MessageType.UNKNOWNto enable filename-based inference.- Parameters:
message_type (MessageType)
- Return type:
None
- read_message()[source]¶
Read the next message from the text trace file.
- Returns:
ReadResult on success, None if no more messages.
- Return type:
ReadResult | None
- property message_type: MessageType¶