plestylib.solver.iceblock
=========================

.. py:module:: plestylib.solver.iceblock


Classes
-------

.. autoapisummary::

   plestylib.solver.iceblock.ICEBLOCKSolver


Module Contents
---------------

.. py:class:: ICEBLOCKSolver

   Bases: :py:obj:`plestylib.solver.OpSolver`


   Operation solver for the ICEBLOCK JSON message protocol.

   The solver builds compact JSON messages with an auto-incrementing
   ``transmission_id`` token and provides helpers to decode responses and
   evaluate success status.


   .. py:attribute:: tk
      :value: 1



   .. py:method:: _build_msg(op, parameters=None)

      Build a protocol message and serialize it as compact JSON.

      :param op: Operation name sent to the remote device.
      :param parameters: Optional operation parameters dictionary.

      :returns: ``{"message": {"transmission_id": [id], "op": op, ...}}``
      :rtype: JSON string in the shape



   .. py:method:: get_startLink_cmd(ip_address)

      Create the ``start_link`` command payload.

      :param ip_address: Remote ICEBLOCK endpoint address.

      :returns: Serialized JSON command for ``start_link``.



   .. py:method:: decode_response(response)

      Decode a JSON response and return its ``message`` object.

      :param response: Raw response text from the device.

      :returns: The decoded ``message`` dictionary when parsing succeeds,
                otherwise ``None`` after error handling.



   .. py:method:: status_ok(response)

      Check whether a response contains ``parameters.status == 'ok'``.

      :param response: Either a decoded response dictionary or raw JSON text.

      :returns: ``True`` when status is ``ok``; otherwise ``False``.



