plestylib.service.tcp_ip_client
===============================

.. py:module:: plestylib.service.tcp_ip_client


Classes
-------

.. autoapisummary::

   plestylib.service.tcp_ip_client.DeviceTCPIPClient


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

.. py:class:: DeviceTCPIPClient(address='tcp://localhost:5555', timeout=5000)

   ZeroMQ-based client for remote device control.

   This client provides a transparent interface to a remote device server.
   Methods can be invoked as if the device were local.

   Features:
       - Standard query/write interface
       - Arbitrary remote function calls
       - Automatic method discovery and binding
       - Timeout support
       - Structured error handling

   Initialize the device client.

   :param address: Server address.
   :param timeout: Receive timeout in milliseconds.


   .. py:attribute:: ctx


   .. py:attribute:: socket


   .. py:attribute:: _description


   .. py:method:: _send(payload)

      Send a request to the server and wait for response.

      :param payload: Dictionary payload.

      :returns: Result from server.
      :rtype: Any

      :raises RuntimeError: If server returns an error.
      :raises TimeoutError: If no response is received.



   .. py:method:: query(param, timeout=None)

      Query a device parameter.

      :param param: Parameter name.
      :param timeout: Optional timeout in seconds (server-side).

      :returns: Parameter value.
      :rtype: Any



   .. py:method:: write(param, value, timeout=None)

      Write a device parameter.

      :param param: Parameter name.
      :param value: Value to set.
      :param timeout: Optional timeout in seconds (server-side).

      :returns: Result from device.
      :rtype: Any



   .. py:method:: call(func, *args, timeout=None, **kwargs)

      Call a remote device function.

      :param func: Function name.
      :param args: Positional arguments.
      :param timeout: Optional timeout in seconds (server-side).
      :param kwargs: Keyword arguments.

      :returns: Function result.
      :rtype: Any



   .. py:method:: describe()

      Retrieve available device methods from server.

      :returns: Device description.
      :rtype: dict



   .. py:method:: _build_methods()

      Dynamically attach remote methods as local methods.



   .. py:method:: _make_proxy(name)

      Create a proxy method for a remote function.

      :param name: Function name.

      :returns: Proxy method.
      :rtype: callable



