some fixes again
This commit is contained in:
@@ -361,7 +361,16 @@ class LaserController:
|
||||
raw = self._protocol.receive_raw(2)
|
||||
if raw and len(raw) == 2:
|
||||
state = Protocol.decode_state(raw)
|
||||
logger.debug("STATE response after command: 0x%04x", state)
|
||||
if state != 0:
|
||||
# Surface a device-reported non-OK STATE instead of silently treating
|
||||
# a board-rejected command as success. (Returned to the caller too.)
|
||||
logger.warning(
|
||||
"Device returned non-OK STATE 0x%04x after command: %s",
|
||||
state,
|
||||
Protocol.state_to_description(f"{state:04x}"),
|
||||
)
|
||||
else:
|
||||
logger.debug("STATE response after command: 0x%04x", state)
|
||||
return state
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user