Skip to main content

BACnetEventParameter

Enum BACnetEventParameter 

Source
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

§time_delay: u32

time-delay [0] Unsigned — debounce seconds.

§bitmask: (u8, Vec<u8>)

bitmask [1] BIT STRING — bits of interest.

§list_of_values: Vec<(u8, Vec<u8>)>

list-of-bitstring-values [2], a list of bit strings — alarm values.

§

ChangeOfState

change-of-state [1]: report when the monitored value matches a configured BACnetPropertyStates value.

Fields

§time_delay: u32

time-delay [0] Unsigned — debounce seconds.

§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

§time_delay: u32

time-delay [0] Unsigned — debounce seconds.

§criteria: ChangeOfValueCriteria

cov-criteria [1] CHOICE.

§

FloatingLimit

floating-limit [4]: report when the value leaves a band around a setpoint reference.

Fields

§time_delay: u32

time-delay [0] Unsigned — debounce seconds.

§setpoint_reference: BACnetDeviceObjectPropertyReference

setpoint-reference [1] BACnetDeviceObjectPropertyReference — where the moving setpoint is read.

§low_diff_limit: f32

low-diff-limit [2] REAL — how far below the setpoint the value may fall.

§high_diff_limit: f32

high-diff-limit [3] REAL — how far above the setpoint the value may rise.

§deadband: f32

deadband [4] REAL — hysteresis applied on the return to normal.

§

OutOfRange

out-of-range [5]: report when the value leaves a fixed band.

Fields

§time_delay: u32

time-delay [0] Unsigned — debounce seconds.

§low_limit: f32

low-limit [1] REAL.

§high_limit: f32

high-limit [2] REAL.

§deadband: f32

deadband [3] REAL.

§

Extended

extended [9]: vendor-defined algorithm.

Fields

§vendor_id: u16

vendor-id [0] Unsigned16.

§extended_event_type: u32

extended-event-type [1] Unsigned.

§parameters: Vec<u8>

Encoded parameters [2] list items (each a CHOICE), without the enclosing tag pair.

§

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.

Fields

§tag: u8

The unrecognized algorithm tag.

§data: Vec<u8>

The raw parameter bytes.

Implementations§

Source§

impl BACnetEventParameter

Source

pub fn tag(&self) -> u8

Return the algorithm tag for this alternative.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for BACnetEventParameter

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BACnetEventParameter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for BACnetEventParameter

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BACnetEventParameter

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.