Skip to main content

Module primitives

Module primitives 

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

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 data at offset.
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_unsigned
Decode an unsigned integer from big-endian bytes (1-8 bytes).
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 PropertyValue as 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_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.