Skip to main content

Module tags

Module tags 

Source
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 per Clause 20.2.1.4.

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 data starting at offset.
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.