Comm

All applications have to have some kind of outer blcok.

Globals

comm.client_map

This is …

comm.server_map

This is …

comm.service_map

This is …

comm.element_map

This is …

Functions

comm.bind(*args)
Parameters: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) - information about addressing, processing instructions - and data. The set of classes in this module are not specific to BACnet.

class comm.PCI
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.

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.

__init__([source=addr][,destination=addr])
Parameters:
  • source (addr) – the initial source value
  • destination (addr) – the initial destination value

Protocol Control Information is generally the context information and/or other types of processing instructions.

class comm.PDUData

The PDUData class has functions for extracting information from the front of the data octet string, or append information to the end. These are helper functions but may not be applicable for higher layer protocols which may be passing significantly more complex data.

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.

get()

Extract a single octet from the front of the data. If the octet string is empty this will raise a DecodingError.

get_data(len)
Parameters:len (integer) – the number of octets to extract.

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.

get_short()

Extract a short integer (two octets) from the front of the data.

get_long()

Extract a long integer (four octets) from the front of the data.

put(ch)
Parameters:ch (octet) – the octet to append to the end
put_data(data)
Parameters:data (string) – the octet string to append to the end
put_short(n)
Parameters:integer (short) – two octets to append to the end
put_long(n)
Parameters:integer (long) – four octets to append to the end
class comm.PDU(PCI, PDUData)

The PDU class combines the PCI and PDUData classes together into one object.

Protocol Stack Classes

class comm.Client
class comm.Server
class comm.Debug
class comm.Echo

Application Classes

class comm.ServiceAccessPoint
class comm.ApplicationServiceElement
class comm.NullServiceElement
class comm.DebugServiceElement