Expand description
BACnet ASN.1 tag encoding and decoding per ASHRAE 135-2020 Clause 20.2.1.
BACnet uses a tag-length-value (TLV) encoding with two tag classes:
- Application tags identify the datatype (Null=0, Boolean=1, …, ObjectIdentifier=12)
- Context tags identify a field within a constructed type (tag number = field index)
Tags also support opening/closing markers for constructed (nested) values.
Modules§
- app_tag
- Application tag numbers.
Structs§
- Tag
- A decoded BACnet tag header.
Enums§
- TagClass
- Tag class: application (datatype) or context (field identifier).
Constants§
- MAX_
CONTEXT_ NESTING_ DEPTH - Maximum nesting depth for context tags to prevent stack overflow from crafted packets.
Functions§
- decode_
optional_ context - Try to decode an optional context-tagged primitive value.
- decode_
tag - Decode a tag from
datastarting atoffset. - encode_
closing_ tag - Encode a context-specific closing tag.
- encode_
opening_ tag - Encode a context-specific opening tag.
- encode_
tag - Encode a tag header into the buffer.
- extract_
context_ value - Extract raw bytes enclosed by a context opening/closing tag pair.