pub enum BACnetEventParameter {
ChangeOfBitstring {
time_delay: u32,
bitmask: (u8, Vec<u8>),
list_of_values: Vec<(u8, Vec<u8>)>,
},
ChangeOfState {
time_delay: u32,
list_of_values: Vec<BACnetPropertyStates>,
},
ChangeOfValue {
time_delay: u32,
criteria: ChangeOfValueCriteria,
},
FloatingLimit {
time_delay: u32,
setpoint_reference: BACnetDeviceObjectPropertyReference,
low_diff_limit: f32,
high_diff_limit: f32,
deadband: f32,
},
OutOfRange {
time_delay: u32,
low_limit: f32,
high_limit: f32,
deadband: f32,
},
Extended {
vendor_id: u16,
extended_event_type: u32,
parameters: Vec<u8>,
},
Opaque {
tag: u8,
data: Vec<u8>,
},
}Expand description
Structured Event_Parameters for an EventEnrollment object.
Models the evaluated algorithm alternatives of the BACnetEventParameter
CHOICE that this library can evaluate.
Unknown or vendor-defined alternatives are preserved verbatim via
BACnetEventParameter::Opaque so that values written by a remote client
are never silently discarded.
The wire form is the full ASN.1 CHOICE framing of the Clause 21
production, produced by
bacnet_encoding::constructed::encode_event_parameter /
decode_event_parameter and carried in
PropertyValue::ApplicationData. The PropertyValue::List form here
(leading algorithm tag as PropertyValue::Unsigned; see
BACnetEventParameter::encode and BACnetEventParameter::decode) is
the LEGACY pre-framing layout, kept for compatibility with values written
before the framing migration (#154).
Variants§
ChangeOfBitstring
change-of-bitstring [0]: report when masked bits match a value.
Fields
ChangeOfState
change-of-state [1]: report when the monitored value matches a
configured BACnetPropertyStates value.
Fields
list_of_values: Vec<BACnetPropertyStates>list-of-values [1], a list of BACnetPropertyStates — alarm values.
ChangeOfValue
change-of-value [2]: report on a bitmask or increment change.
Fields
criteria: ChangeOfValueCriteriacov-criteria [1] CHOICE.
FloatingLimit
floating-limit [4]: report when the value leaves a band around a
setpoint reference.
Fields
setpoint_reference: BACnetDeviceObjectPropertyReferencesetpoint-reference [1] BACnetDeviceObjectPropertyReference — where
the moving setpoint is read.
OutOfRange
out-of-range [5]: report when the value leaves a fixed band.
Fields
Extended
extended [9]: vendor-defined algorithm.
Fields
Opaque
Preserves an unmodeled constructed alternative or none [20] NULL.
For constructed alternatives, data is the complete SEQUENCE body.
Opaque { tag: 20, data: [] } represents the primitive none value.
The framed encoder rejects modeled and reserved tags in this variant.
Implementations§
Source§impl BACnetEventParameter
impl BACnetEventParameter
Sourcepub fn encode(&self) -> PropertyValue
pub fn encode(&self) -> PropertyValue
Encode this parameter set as a flat PropertyValue::List.
The first element is the algorithm tag as PropertyValue::Unsigned,
followed by the variant’s fields in declaration order. This is the
LEGACY pre-framing layout (see #154); the wire form is the full ASN.1
framing from bacnet_encoding::constructed::encode_event_parameter.
See Self::decode for the inverse.
Sourcepub fn decode(value: &PropertyValue) -> Result<Self, Error>
pub fn decode(value: &PropertyValue) -> Result<Self, Error>
Decode a PropertyValue previously produced by Self::encode.
Returns Ok with the reconstructed parameter set, or a decoding
Error when the value is not a List, is empty, or has an
unrecognized/inconsistent shape. Opaque values round-trip unchanged.