Expand description
Application-tagged primitive encode/decode per ASHRAE 135-2020 Clause 20.2.
Provides both raw value codecs (no tag header) and application/context-tagged convenience functions for all BACnet primitive types.
Modules§
- charset
- Character set identifiers.
Constants§
- MAX_
TIMESTAMP_ SEQUENCE_ NUMBER - Largest encodable
sequence-numbervalue: the production constrains it toUnsigned (0..65535).
Functions§
- character_
string_ len - Return the encoded length of a character string (charset byte + UTF-8 bytes).
- decode_
application_ value - Decode a single application-tagged value from
dataatoffset. - decode_
bit_ string - Decode a bit string from content bytes.
- decode_
character_ string - Decode a character string from content bytes.
- decode_
double - Decode an IEEE-754 double-precision float from 8 big-endian bytes.
- decode_
real - Decode an IEEE-754 single-precision float from 4 big-endian bytes.
- decode_
signed - Decode a signed integer from two’s-complement big-endian bytes (1-4 bytes).
- decode_
timestamp - Decode a BACnetTimeStamp from inside a context opening/closing tag pair.
- decode_
timestamp_ choice - Decode a bare-CHOICE
BACnetTimeStampstarting atoffset. - decode_
unsigned - Decode an unsigned integer from big-endian bytes (1-8 bytes).
- decode_
unsigned_ u8 - Decode an unsigned integer that fits in a
u8from 1-8 big-endian bytes. Leading zero bytes are accepted; values aboveu8::MAXare rejected. - decode_
unsigned_ u16 - Decode an unsigned integer that fits in a
u16from 1-8 big-endian bytes. Leading zero bytes are accepted; values aboveu16::MAXare rejected. - decode_
unsigned_ u32 - Decode an unsigned integer that fits in a
u32from 1-8 big-endian bytes. Leading zero bytes are accepted; values aboveu32::MAXare rejected. - encode_
app_ bit_ string - Encode an application-tagged BitString.
- encode_
app_ boolean - Encode an application-tagged Boolean.
- encode_
app_ character_ string - Encode an application-tagged CharacterString (UTF-8).
- encode_
app_ date - Encode an application-tagged Date.
- encode_
app_ double - Encode an application-tagged Double (f64).
- encode_
app_ enumerated - Encode an application-tagged Enumerated.
- encode_
app_ null - Encode an application-tagged Null.
- encode_
app_ object_ id - Encode an application-tagged ObjectIdentifier.
- encode_
app_ octet_ string - Encode an application-tagged OctetString.
- encode_
app_ real - Encode an application-tagged Real (f32).
- encode_
app_ signed - Encode an application-tagged Signed.
- encode_
app_ time - Encode an application-tagged Time.
- encode_
app_ unsigned - Encode an application-tagged Unsigned.
- encode_
bit_ string - Encode a bit string: leading unused-bits count followed by data bytes.
- encode_
character_ string - Encode a UTF-8 character string with leading charset byte.
- encode_
ctx_ bit_ string - Encode a context-tagged BitString.
- encode_
ctx_ boolean - Encode a context-tagged Boolean.
- encode_
ctx_ character_ string - Encode a context-tagged CharacterString (UTF-8).
- encode_
ctx_ date - Encode a context-tagged Date.
- encode_
ctx_ double - Encode a context-tagged Double (f64).
- encode_
ctx_ enumerated - Encode a context-tagged Enumerated.
- encode_
ctx_ object_ id - Encode a context-tagged ObjectIdentifier.
- encode_
ctx_ octet_ string - Encode a context-tagged OctetString.
- encode_
ctx_ real - Encode a context-tagged Real (f32).
- encode_
ctx_ signed - Encode a context-tagged Signed.
- encode_
ctx_ unsigned - Encode a context-tagged Unsigned.
- encode_
double - Encode an IEEE-754 double-precision float (big-endian, 8 bytes).
- encode_
property_ value - Encode a
PropertyValueas an application-tagged value. - encode_
real - Encode an IEEE-754 single-precision float (big-endian, 4 bytes).
- encode_
signed - Encode a signed integer using minimum octets, two’s complement, big-endian.
- encode_
timestamp - Encode a BACnetTimeStamp wrapped in a context opening/closing tag pair.
- encode_
timestamp_ choice - Encode a
BACnetTimeStampas a bare CHOICE element (no enclosing field tag). - encode_
unsigned - Encode an unsigned integer using the minimum number of big-endian octets.
- signed_
len - Return the number of bytes needed to encode a signed value.
- unsigned_
len - Return the number of bytes needed to encode an unsigned value.
- validate_
application_ value - Check that an application-tagged value starts at
offsetand is structurally well formed, returning the offset just past it.