Skip to main content

Module apdu

Module apdu 

Source
Expand description

APDU encoding and decoding per ASHRAE 135-2020 Clause 20.1.

Covers all eight PDU types:

  • ConfirmedRequest (Clause 20.1.2)
  • UnconfirmedRequest (Clause 20.1.3)
  • SimpleAck (Clause 20.1.4)
  • ComplexAck (Clause 20.1.5)
  • SegmentAck (Clause 20.1.6)
  • ErrorPdu (Clause 20.1.7)
  • RejectPdu (Clause 20.1.8)
  • AbortPdu (Clause 20.1.9)

Those owned PDUs need alloc. Without it, header reads and writes the header of an Unconfirmed-Request, an unsegmented Confirmed-Request or an unsegmented ComplexACK, borrowing the service parameters in place.

Modules§

header
The fixed header of the APDUs that carry service parameters, read and written without an allocator (#1614): an Unconfirmed-Request, an unsegmented Confirmed-Request or ComplexACK, and an Error (Clauses 20.1.2, 20.1.3, 20.1.5 and 20.1.7); and the two answers that are all header, a Reject and an Abort (Clauses 20.1.8 and 20.1.9), so a device without a heap can refuse what it doesn’t serve (#1771).

Structs§

AbortPdu
Abort PDU (Clause 20.1.9).
ComplexAck
ComplexACK PDU (Clause 20.1.5).
ConfirmedRequest
Confirmed-Request PDU (Clause 20.1.2).
ErrorPdu
Error PDU (Clause 20.1.7).
RejectPdu
Reject PDU (Clause 20.1.8).
SegmentAck
SegmentACK PDU (Clause 20.1.6).
SimpleAck
SimpleACK PDU (Clause 20.1.4).
UnconfirmedRequest
Unconfirmed-Request PDU (Clause 20.1.3).

Enums§

Apdu
Sum type for all APDU PDU types.

Constants§

MINIMUM_MESSAGE_SIZE
MinimumMessageSize: the smallest APDU any BACnet device accepts.

Functions§

advertised_max_segments
The segment count a configured max-segments-accepted actually promises a peer.
decode_apdu
Decode an APDU from raw bytes.
encode_apdu
Encode an APDU to wire format.
is_valid_max_apdu_length
Return true when value is one of the BACnet max-APDU-length encodings defined by ASHRAE 135-2020 Clause 20.1.2.5.
max_apdu_header_at_or_below
Floor a raw local receive capacity to a Confirmed-Request header value.
validate_max_apdu_length
Validate an exact Confirmed-Request max-APDU-length header value. Only with alloc.
validate_max_segments
Validate a configured maximum segment count for a Confirmed-Request header.