1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! 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.
// Tests always build with std, so feature-off test runs need no imports of
// their own.
compile_error!;
// `format!` and `vec!` without std's prelude.
extern crate alloc;