stoner_measurement.instruments.xray.protocol.LegacyXrayProtocol¶
- class stoner_measurement.instruments.xray.protocol.LegacyXrayProtocol[source]¶
Bases:
BaseProtocolFraming metadata for the controller’s fixed binary response.
The driver bypasses the text formatting API and writes opcodes directly. These formatting methods therefore reject strings rather than risk an accidental ASCII command or line terminator.
- property max_frame_size: int¶
Maximum number of response bytes expected for one protocol frame.
- Returns:
Default frame-size limit used by transports when reading a single response frame.
- Return type:
(int)
- parse_response(raw: bytes, *, command: str | None = None) str[source]¶
Parse a raw response from the instrument.
- Parameters:
raw (bytes) – Raw bytes as returned by the transport layer.
- Keyword Parameters:
command (str | None) – Command/query string that produced raw, when available. Defaults to
None.- Returns:
The cleaned-up response string, stripped of any protocol- specific framing, terminators, or whitespace.
- Return type:
(str)
- terminator = None¶