Skip to main content

Crate bacnet_encoding

Crate bacnet_encoding 

Source
Expand description

BACnet ASN.1/BER encoding and APDU/NPDU codecs per ASHRAE 135-2020.

This crate provides the wire-format encoding and decoding for BACnet:

  • ASN.1 tag encode/decode (Clause 20.2.1)
  • Application-tagged primitive codecs (Clause 20.2)
  • APDU encode/decode (Clause 20.1)
  • NPDU encode/decode (Clause 6)

§Features

The codecs need an allocator, and one of these features to say so:

  • std (default): hosted builds. Also logs, through tracing, an NPDU whose reserved control bits are set.
  • alloc: no_std with a global allocator, for bare-metal targets: default-features = false, features = ["alloc"]. bytes must build for the target; on one without atomic compare-and-swap, such as ARMv6-M, that means its extra-platforms feature and a portable-atomic backend the firmware picks.

A build with neither fails; that combination is reserved for a future allocation-free subset.

Modules§

apdu
APDU encoding and decoding per ASHRAE 135-2020 Clause 20.1.
constructed
Full ASN.1 framing codecs for constructed Clause-21 types whose property values are CHOICE/SEQUENCE productions — context-tagged framing per ASHRAE 135-2020 Clause 20.2.1.5/20.2.1.6.
npdu
NPDU encoding and decoding per ASHRAE 135-2020 Clause 6.
primitives
Application-tagged primitive encode/decode per ASHRAE 135-2020 Clause 20.2.
segmentation
Segmentation: split and reassemble large APDU payloads.
tags
BACnet ASN.1 tag encoding and decoding per ASHRAE 135-2020 Clause 20.2.1.