Skip to main content

Module recipient

Module recipient 

Source
Expand description

Recipient_List full ASN.1 framing (ASHRAE 135-2020 Clauses 12.21, 21).

The property is a BACnetLIST of BACnetDestination, so on the wire it is the destinations back to back with no list wrapper. A destination has seven members and none carries a context tag, so they travel in this order as application-tagged elements (the recipient CHOICE brings its own tags):

MemberWire form
valid-daysBit String (BACnetDaysOfWeek)
from-timeTime
to-timeTime
recipientBACnetRecipient CHOICE, see below
process-identifierUnsigned, 32-bit range
issue-confirmed-notificationsBoolean
transitionsBit String (BACnetEventTransitionBits)

BACnetRecipient picks either device [0], an object identifier, or address [1], a BACnetAddress. The device form tags a primitive ObjectIdentifier — a context-specific PRIMITIVE tag 0, length 4. BACnetAddress is constructed (a 16-bit network number, then the MAC address as an OCTET STRING, both application-tagged), so address [1] is an opening tag 1 / application-tagged Unsigned16 + OCTET STRING / closing tag 1.

A BACnetAddress MAC is at most BACnetAddress::MAX_MAC_LEN octets in both directions: decode_recipient refuses a longer one before copying it (#1124 for configured recipients, #1156 everywhere else) and encode_recipient refuses to write one. Every other codec that carries a BACnetAddress (ValueSource, the AuditLogQuery filters) shares check_decoded_mac_len and check_encoded_mac_len, so the bound has one definition. The source addresses the stack learns off the network fit it too: the NPDU codec bounds SADR the same way (#1141), and the network layer drops a frame from a longer link-layer source MAC (#1198).

Functions§

check_decoded_mac_len
Refuse, as a decode error at offset, a BACnetAddress mac-address whose OCTET STRING holds more than BACnetAddress::MAX_MAC_LEN octets (#1156), or any other OCTET STRING that names a MAC on a data link, such as the You-Are device MAC (#1200). Decoders call it on the tag’s length, before copying any octet.
check_encoded_mac_len
Refuse to encode a MAC longer than BACnetAddress::MAX_MAC_LEN octets, which check_decoded_mac_len would refuse on the way back in: a BACnetAddress mac-address (#1156) or the You-Are device MAC (#1200).
decode_destination
Decode one BACnetDestination at offset; returns it and the offset past the last member. Its recipient decodes through decode_recipient, so an address MAC past BACnetAddress::MAX_MAC_LEN octets is refused (#1124).
decode_destination_list
Decode a whole Recipient_List (BACnetLIST of BACnetDestination — concatenated entries). Every entry must parse; trailing garbage errors.
decode_recipient
Decode one BACnetRecipient at offset.
encode_destination
Encode one BACnetDestination.
encode_destination_list
Encode a BACnetLIST of BACnetDestination: plain concatenation, no wrapper (Clause 12.21 Recipient_List). Every destination is checked before buf changes, so a refused list writes nothing.
encode_recipient
Encode a BACnetRecipient. An address MAC past BACnetAddress::MAX_MAC_LEN octets is an error, returned before buf changes.