=================== The Pyrame protocol =================== This document describes the protocol used by Pyrame modules to communicate. The Pyrame module concept ========================= In Pyrame, a module is a piece of software that handles a type of hardware device. Generally, it can handle multiple devices of the same flavour. This module will be able to treat requests if they are expressed in the Pyrame protocol. It will handle the access to its hardware, performing the conversion of data format between the hardware and Pyrame. The protocol ============ A Pyrame command is expressed in XML language and sent through a TCP socket with the following form : .. code-block:: xml where *name_of_command* is the name of the Pyrame command. A linefeed character (ascii 10) must terminate every command. Arguments can be passed to the command by using the ```` tags inside the ```` block. For example: .. code-block:: xml hello world hello world2 Responses from a Pyrame module are also in XML language and expressed in the form: .. code-block:: xml *X* must be an integer and indicates the result of the command. Zero is failure. A linefeed character (ascii 10) must terminate every response. Additional information can be returned by including it inside the ```` block. For example: .. code-block:: xml hello to you, too .. warning:: Since both commands and responses are ended with a linefeed character, these characters must be escaped as \\n or \\r respectively in order to be transferred to and from Pyrame modules. .. note:: If the characters ``<`` or ``>`` need to be included in either commands or responses, the ```` block must be used to prevent the XML parser from parsing those values. For example: .. code-block:: xml 10]]> ]]> **This is systematically done by cmdmod on all responses.**