From cf1be119dd79c1a88ecfe071839da0e8cb7f5bd4 Mon Sep 17 00:00:00 2001 From: Camillo Moschner Date: Fri, 13 Nov 2026 19:29:37 +0000 Subject: [PATCH] v1 `CLARIOstar`: the firmware range named by its line `DECODED_FIRMWARE` becomes `FIRMWARE_1_RANGE`, unchanged at (1300, 1999): the 1.x line's range, so a 2.x range can sit beside it. No bytes sent and no results change. Co-Authored-By: Claude Opus 5.5 --- .../bmg_labtech/clariostar/driver/configuration.py | 10 +++++----- pylabrobot/bmg_labtech/clariostar/driver/master.py | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pylabrobot/bmg_labtech/clariostar/driver/configuration.py b/pylabrobot/bmg_labtech/clariostar/driver/configuration.py index ef8b229161b..5551c9b85ea 100644 --- a/pylabrobot/bmg_labtech/clariostar/driver/configuration.py +++ b/pylabrobot/bmg_labtech/clariostar/driver/configuration.py @@ -10,9 +10,9 @@ INIT_REPLY_TYPE = 0x13 -# The firmware whose replies are decoded, as (lowest, highest) firmware number x 1000: the 1.x line. -# Older firmware is untested; 2.x (the line with native USB) lays its replies out unseen. -DECODED_FIRMWARE = (1300, 1999) +# The 1.x firmware whose replies are read, as (lowest, highest) firmware number x 1000. Older +# firmware is untested; 2.x (the line with native USB) lays its replies out differently. +FIRMWARE_1_RANGE = (1300, 1999) _BARCODE_READER_TYPES = {0: "SE 923", 1: "CSE 600", 2: "SE 955", 3: "SE 965"} BARCODE_READER_POSITIONS = ("front", "right", "optional 1", "optional 2") @@ -218,7 +218,7 @@ def update_from_init_reply(self, payload: bytes) -> None: Raises: ValueError: if the payload is not a whole INIT reply, or comes from firmware outside - `DECODED_FIRMWARE`; the main board fields are filled either way. + `FIRMWARE_1_RANGE`; the main board fields are filled either way. """ blocks = dict(_blocks(payload)) main_board = _block(blocks, 0x01, 5) @@ -227,7 +227,7 @@ def update_from_init_reply(self, payload: bytes) -> None: self.firmware_build = main_board[2] self.mainboard_revision = main_board[4] self.model = "CLARIOstarPlus" if main_board[4] >= 2 else "CLARIOstar" - if not DECODED_FIRMWARE[0] <= firmware <= DECODED_FIRMWARE[1]: + if not FIRMWARE_1_RANGE[0] <= firmware <= FIRMWARE_1_RANGE[1]: raise ValueError(f"INIT reply of firmware {self.firmware_version} is not decoded here") for update in ( self._update_from_detectors, diff --git a/pylabrobot/bmg_labtech/clariostar/driver/master.py b/pylabrobot/bmg_labtech/clariostar/driver/master.py index 9c5bac1d207..b3047d1507b 100644 --- a/pylabrobot/bmg_labtech/clariostar/driver/master.py +++ b/pylabrobot/bmg_labtech/clariostar/driver/master.py @@ -29,7 +29,7 @@ from .configuration import ( BARCODE_READER_POSITIONS, - DECODED_FIRMWARE, + FIRMWARE_1_RANGE, FITTED_FIELDS, DeviceConfiguration, configuration_to_json, @@ -563,7 +563,7 @@ def _decode_parameters(payload: bytes) -> Dict[str, int]: """A stored parameters reply's values, by key (see ``PARAMETER_TABLE``). Raises: - ValueError: if the reply comes from firmware outside ``DECODED_FIRMWARE``. + ValueError: if the reply comes from firmware outside ``FIRMWARE_1_RANGE``. """ parameters = { name: int.from_bytes( @@ -573,7 +573,7 @@ def _decode_parameters(payload: bytes) -> Dict[str, int]: ) for name, address, size in PARAMETER_TABLE } - if not DECODED_FIRMWARE[0] <= parameters["firmware_version"] <= DECODED_FIRMWARE[1]: + if not FIRMWARE_1_RANGE[0] <= parameters["firmware_version"] <= FIRMWARE_1_RANGE[1]: raise ValueError( f"stored parameters of firmware {parameters['firmware_version']} are not decoded" ) @@ -604,7 +604,7 @@ async def request_parameters(self) -> Dict[str, int]: Raises: ValueError: if the reply is not a whole stored parameters reply, or comes from firmware - outside ``DECODED_FIRMWARE``. + outside ``FIRMWARE_1_RANGE``. """ return self._decode_parameters(await self._request_parameters_reply())