1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-05 22:18:16 +08:00
bacpypes/doc/source/modules/comm.rst

138 lines
3.2 KiB
ReStructuredText

.. BACpypes comm module
.. module:: comm
Comm
====
All applications have to have some kind of outer blcok.
Globals
-------
.. data:: client_map
This is ...
.. data:: server_map
This is ...
.. data:: service_map
This is ...
.. data:: element_map
This is ...
Functions
---------
.. function:: bind(*args)
:param args: a list of clients and servers to bind together in a stack
Protocol Data Units
-------------------
A Protocol Data Unit (PDU) is the name for a collection of information that
is passed between two entities. It is composed of Protcol Control Information
(PCI), which usually has information about addressing and other types of
processing instructions, and data. The set of classes in this module are not
specific to BACnet.
.. class:: PCI
.. attribute:: pduSouce
The source of a PDU. The datatype and composition of the address is
dependent on the client/server relationship and protocol context. The
source may be `None`, in which case it has no source or the source is
implicit.
.. attribute:: pduDestination
The destination of a PDU. The datatype and composition of the address
is dependent on the client/server relationship and protocol context.
The destination may be `None`, in which case it has no destination or the
destination is implicit.
.. method:: __init__([source=addr][,destination=addr])
:param addr source: the initial source value
:param addr destination: the initial destination value
Protocol Control Information is generally the context information and/or
other types of processing instructions.
.. class:: PDUData
.. attribute:: pduData
This attribute typically holds a simple octet string, but for higher
layers of a protocol stack it may contain more abstract pieces or
components.
.. method:: get()
Extract a single octet from the front of the data. If the octet string
is empty this will raise a DecodingError.
.. method:: get_data(len)
:param integer len: the number of octets to extract off the front
Extract a number of octets from the front of the data. If there
are not at least `len` octets this will raise a DecodingError
exception.
.. method:: get_short()
.. method:: get_long()
.. method:: put(ch)
:param octet ch: the octet to append to the end
.. method:: put_data(data)
:param string data: the octet string to append to the end
.. method:: put_short(n)
.. method:: put_long(n)
The PDUData class has functions for gathering information from the front
of the octet string, or putting information on the end. These are helper
functions but may not be applicable for higher layer protocols which may
be passing significantly more complex data.
.. class:: PDU(PCI, PDUData)
The PDU class combines the PCI and PDUData classes together into one
object.
Protocol Stack Classes
----------------------
.. class:: Client
.. class:: Server
.. class:: Debug
.. class:: Echo
Application Classes
-------------------
.. class:: ServiceAccessPoint
.. class:: ApplicationServiceElement
.. class:: NullServiceElement
.. class:: DebugServiceElement