Skip to main content

Module fault_parameter

Module fault_parameter 

Source
Expand description

BACnetFaultParameter full ASN.1 framing.

Production (ASHRAE 135-2020 Clause 21), modeled by FaultParameters:

BACnetFaultParameter ::= CHOICE {
    none                 [0] NULL,
    fault-characterstring [1] SEQUENCE { list-of-fault-values [0] SEQUENCE OF CharacterString },
    fault-extended       [2] SEQUENCE { vendor-id [0] Unsigned16,
                                        extended-fault-type [1] Unsigned,
                                        parameters [2] SEQUENCE OF CHOICE { ... } },
    fault-life-safety    [3] SEQUENCE { list-of-fault-values [0] SEQUENCE OF BACnetLifeSafetyState,
                                        mode-property-reference [1] BACnetDeviceObjectPropertyReference },
    fault-state          [4] SEQUENCE { list-of-fault-values [0] SEQUENCE OF BACnetPropertyStates },
    fault-status-flags   [5] SEQUENCE { status-flags-reference [0] BACnetDeviceObjectPropertyReference },
    fault-out-of-range   [6] SEQUENCE { min-normal-value [0] CHOICE { real REAL, unsigned Unsigned,
                                                                        double Double, integer INTEGER },
                                        max-normal-value [1] CHOICE { ... same ... } },
    fault-listed         [7] SEQUENCE { fault-list-reference [0] BACnetDeviceObjectPropertyReference } }

The min/max inner CHOICE alternatives are untagged — discovered by their APPLICATION tag (REAL=4, Unsigned=2, Double=5, INTEGER=3). The Rust type stores f64, so encode always selects the Double alternative; decode accepts all four.

Functions§

decode_fault_parameters
Decode one framed FaultParameters CHOICE alternative at offset.
encode_fault_parameters
Encode a FaultParameters as its full CHOICE framing.