Skip to main content

Module npdu

Module npdu 

Source
Expand description

The owned NPDU (ASHRAE 135-2020 Clause 6) and its codec.

The Network Protocol Data Unit carries either an application-layer APDU or a network-layer message, with optional source/destination routing information for multi-hop BACnet internetworks.

Npdu holds its addresses and payload in owned buffers. It decodes and encodes through bacnet-npdu’s borrowed view, the one NPDU codec of the stack, so the router core, the non-router network layer and every layer above them accept and refuse the same frames. Both directions hold DADR and SADR to MAX_MAC_LEN octets (#1141), so everything above the network layer only ever sees an address that some data link could carry.

Re-exports§

pub use bacnet_npdu as view;

Structs§

Npdu
Decoded Network Protocol Data Unit (Clause 6.2).
NpduAddress
Network-layer address: network number + MAC address.

Enums§

NpduDecodeError
Why decode_npdu refused an NPDU: bacnet-npdu’s DecodeError, with the source behind an over-long DADR owned.

Functions§

decode_npdu
Decode an NPDU from raw bytes.
encode_npdu
Encode an NPDU to wire format, appending it to buf.