BACnet.Protocol.NotificationParameters (bacstack v0.1.0-dev.1)

Copy Markdown View Source

BACnet notification parameters define the additional data that is included in ConfirmedEventNotification and UnconfirmedEventNotification messages.

Different event algorithms produce different sets of notification parameters (e.g. the new value that triggered the alarm, the setpoint that was crossed, timestamps, etc.). These structures are carried inside the Event Message Parameters of the notification so that receiving devices and operator workstations have rich context without needing to read additional properties.

This module provides the encoding/decoding layer for all supported notification parameter variants. The inner modules contain the concrete fields for each algorithm's notification data.

The event algorithm AccessEvent is not supported.

Consult the module BACnet.Protocol.EventAlgorithms for details about each event's algorithms. Consult the module BACnet.Protocol.EventParameters for details about each event's parameters.

Examples

Different notification parameter types (CHOICE arms):

# Change of Value
iex> %NotificationParameters.ChangeOfValue{
...>   new_value: {:real, 42.5},
...>   status_flags: %StatusFlags{}
...> }

# Out of Range (common for analog alarms)
iex> %NotificationParameters.OutOfRange{
...>   exceeding_value: 105.0,
...>   status_flags: %StatusFlags{fault: false},
...>   deadband: 2.0,
...>   exceeded_limit: 100.0
...> }

Summary

Types

Possible BACnet notification parameters.

Functions

Encodes a notification parameter variant into BACnet application tag encoding.

Parses a constructed application tag (from an event notification) into the corresponding notification parameter.

Validates whether the given notification parameter is in form valid.

Types

Functions

encode(notification_params, opts \\ [])

@spec encode(notification_parameter(), Keyword.t()) ::
  {:ok, BACnet.Protocol.ApplicationTags.encoding()} | {:error, term()}

Encodes a notification parameter variant into BACnet application tag encoding.

parse(notification_values_tag)

@spec parse(BACnet.Protocol.ApplicationTags.encoding()) ::
  {:ok, notification_parameter()} | {:error, term()}

Parses a constructed application tag (from an event notification) into the corresponding notification parameter.

valid?(t)

@spec valid?(notification_parameter()) :: boolean()

Validates whether the given notification parameter is in form valid.

It only validates the struct is valid as per type specification.