From 97786576cf4dc2aaee5d10c737f44eb30c6923ae Mon Sep 17 00:00:00 2001 From: bremme Date: Sun, 27 Dec 2020 18:58:14 +0100 Subject: [PATCH] Add SocketReader documentation --- README.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.rst b/README.rst index 03de485..b2d932f 100644 --- a/README.rst +++ b/README.rst @@ -43,6 +43,25 @@ process because the code is blocking (not asynchronous): To be documented. +**Socket client** + +Read a remote serial port (for example using ser2net) and work with the parsed telegrams. +It should be run in a separate process because the code is blocking (not asynchronous): + +.. code-block:: python + + from dsmr_parser import telegram_specifications + from dsmr_parser.clients import SocketReader + + socket_reader = SocketReader( + host='127.0.0.1', + port=2001, + telegram_specification=telegram_specifications.V4 + ) + + for telegram in socket_reader.read(): + print(telegram) # see 'Telegram object' docs below + Parsing module usage --------------------