stoner_measurement.instruments.protocol.signal_recovery.SignalRecoveryProtocol

class stoner_measurement.instruments.protocol.signal_recovery.SignalRecoveryProtocol(terminator: bytes = b'\r\n', *, max_frame_size: int = 4194304)[source]

Bases: BaseProtocol

Format 7265 commands and remove its optional RS-232 prompt.

The 7265 uses the command mnemonic without parameters as a query. Thus command and query formatting are deliberately identical. On RS-232 the response terminator is followed by * for success or ? for error; GPIB responses need not contain a prompt.

property errors_in_response: bool

Return true because RS-232 prompt errors are response-embedded.

format_command(command: str) → bytes[source]

Encode a command with the configured terminator.

format_query(query: str) → bytes[source]

Encode a query; the 7265 does not use a question-mark suffix.

property max_frame_size: int

Return the largest accepted response frame.

parse_response(raw: bytes, *, command: str | None = None) → str[source]

Decode a response, removing terminators and a success prompt.