BACnet event parameters describe the specific configuration and thresholds
used by each event algorithm (see BACnet.Protocol.EventAlgorithms).
Every object that supports intrinsic or algorithmic event reporting uses one
of these parameter structures inside its event_parameters property. The
choice of parameter type determines what conditions will cause the object to
transition between NORMAL, OFFNORMAL, FAULT, and other event states, and what
additional data is included in the resulting event notifications.
This module provides the top-level encoding and parsing functions for all supported event parameter variants. The individual parameter modules (ChangeOfBitstring, OutOfRange, BufferReady, etc.) contain the actual fields and logic for each algorithm.
Note: The AccessEvent algorithm and its parameters are not supported.
Examples
Common event parameter configurations (these are CHOICE variants):
# OutOfRange (very common for analog alarming)
iex> %EventParameters.OutOfRange{
...> time_delay: 30,
...> low_limit: 10.0,
...> high_limit: 90.0,
...> deadband: 2.0
...> }
# ChangeOfState
iex> %EventParameters.ChangeOfState{
...> time_delay: 0,
...> alarm_values: [true]
...> }
# BufferReady (for trend logs)
iex> %EventParameters.BufferReady{
...> threshold: 100,
...> previous_count: 0
...> }These are placed inside the object's event_parameters property. Different objects support different subsets of these parameter types.
Summary
Types
Possible BACnet event parameters.
Functions
Encodes an EventParameters struct (any of the algorithm variants) into the application-tag encoding.
Parses the encoded event values from a notification or Event Enrollment object back into the corresponding EventParameters variant struct.
Validates whether the given event parameter is in form valid.
Types
@type event_parameter() :: BACnet.Protocol.EventParameters.ChangeOfBitstring.t() | BACnet.Protocol.EventParameters.ChangeOfState.t() | BACnet.Protocol.EventParameters.ChangeOfValue.t() | BACnet.Protocol.EventParameters.CommandFailure.t() | BACnet.Protocol.EventParameters.FloatingLimit.t() | BACnet.Protocol.EventParameters.OutOfRange.t() | BACnet.Protocol.EventParameters.ChangeOfLifeSafety.t() | BACnet.Protocol.EventParameters.Extended.t() | BACnet.Protocol.EventParameters.BufferReady.t() | BACnet.Protocol.EventParameters.UnsignedRange.t() | BACnet.Protocol.EventParameters.DoubleOutOfRange.t() | BACnet.Protocol.EventParameters.SignedOutOfRange.t() | BACnet.Protocol.EventParameters.UnsignedOutOfRange.t() | BACnet.Protocol.EventParameters.ChangeOfCharacterString.t() | BACnet.Protocol.EventParameters.ChangeOfStatusFlags.t() | BACnet.Protocol.EventParameters.None.t()
Possible BACnet event parameters.
Functions
@spec encode(event_parameter(), Keyword.t()) :: {:ok, BACnet.Protocol.ApplicationTags.encoding()} | {:error, term()}
Encodes an EventParameters struct (any of the algorithm variants) into the application-tag encoding.
@spec parse(binary()) :: {:ok, event_parameter()} | {:error, term()}
Parses the encoded event values from a notification or Event Enrollment object back into the corresponding EventParameters variant struct.
@spec valid?(event_parameter()) :: boolean()
Validates whether the given event parameter is in form valid.
It only validates the struct is valid as per type specification.