plestylib.solver.iceblock#
Classes#
Operation solver for the ICEBLOCK JSON message protocol. |
Module Contents#
- class plestylib.solver.iceblock.ICEBLOCKSolver#
Bases:
plestylib.solver.OpSolverOperation solver for the ICEBLOCK JSON message protocol.
The solver builds compact JSON messages with an auto-incrementing
transmission_idtoken and provides helpers to decode responses and evaluate success status.- tk = 1#
- _build_msg(op, parameters=None)#
Build a protocol message and serialize it as compact JSON.
- Parameters:
op – Operation name sent to the remote device.
parameters – Optional operation parameters dictionary.
- Returns:
{"message": {"transmission_id": [id], "op": op, ...}}- Return type:
JSON string in the shape
- get_startLink_cmd(ip_address)#
Create the
start_linkcommand payload.- Parameters:
ip_address – Remote ICEBLOCK endpoint address.
- Returns:
Serialized JSON command for
start_link.
- decode_response(response)#
Decode a JSON response and return its
messageobject.- Parameters:
response – Raw response text from the device.
- Returns:
The decoded
messagedictionary when parsing succeeds, otherwiseNoneafter error handling.
- status_ok(response)#
Check whether a response contains
parameters.status == 'ok'.- Parameters:
response – Either a decoded response dictionary or raw JSON text.
- Returns:
Truewhen status isok; otherwiseFalse.