Skip to main content

Module network_port

Module network_port 

Source
Expand description

Clause 21 codecs for the Network Port object’s host and broadcast-table values: BACnetHostAddress, BACnetHostNPort, BACnetBDTEntry and BACnetFDTEntry (Clause 12.56).

The shapes, as the Clause 21 productions lay them out:

  • BACnetHostAddress is a CHOICE of primitive alternatives: [0] NULL for no host, [1] OCTET STRING for an IP address (4 or 16 octets) and [2] CharacterString for a host name.
  • BACnetHostNPort is a SEQUENCE of the host, under [0], and the port as an Unsigned16 under [1]. Since the host is a CHOICE, its [0] is an opening and closing pair around the chosen alternative.
  • BACnetBDTEntry is a SEQUENCE of the BBMD’s BACnetHostNPort under an opening and closing [0], then the optional broadcast mask, a 4-octet OCTET STRING under [1].
  • BACnetFDTEntry is a SEQUENCE of three primitives: the registrant’s address under [0] (6 octets for B/IP, 18 for B/IPv6), then the time to live and the time remaining, each an Unsigned16, under [1] and [2].

A BACnetLIST of entries is the plain concatenation of its elements. None of this is the 10-octet BVLL layout Read-Broadcast-Distribution-Table-Ack and Read-Foreign-Device-Table-Ack carry (Annex J.2), which the transport crate owns.

Decoding is strict: a missing, misplaced, truncated or wrong-sized member, or a port or time past an Unsigned16, is an error.

Functions§

decode_bdt_entry
Decode one bare BACnetBDTEntry SEQUENCE at offset; returns it and the offset past it. A broadcast mask, when present, must be 4 octets.
decode_bdt_entry_list
Decode a complete BACnetLIST of BACnetBDTEntry. Every byte must belong to an element; an empty input is an empty list.
decode_fdt_entry
Decode one bare BACnetFDTEntry SEQUENCE at offset; returns it and the offset past it. The address must be 6 or 18 octets.
decode_fdt_entry_list
Decode a complete BACnetLIST of BACnetFDTEntry. Every byte must belong to an element; an empty input is an empty list.
decode_host_address
Decode one BACnetHostAddress CHOICE alternative at offset; returns it and the offset past it.
decode_host_n_port
Decode one bare BACnetHostNPort SEQUENCE at offset; returns it and the offset past its port.
encode_bdt_entry
Encode one bare BACnetBDTEntry SEQUENCE.
encode_bdt_entry_list
Encode a BACnetLIST of BACnetBDTEntry as concatenated elements.
encode_fdt_entry
Encode one bare BACnetFDTEntry SEQUENCE.
encode_fdt_entry_list
Encode a BACnetLIST of BACnetFDTEntry as concatenated elements.
encode_host_address
Encode one BACnetHostAddress CHOICE alternative.
encode_host_n_port
Encode one bare BACnetHostNPort SEQUENCE.