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

Copy Markdown View Source

Event Transition Bits is a three-bit bit string used throughout the BACnet event and alarm model. Each bit corresponds to one of the three possible state transitions an object can make:

BitTransitionMeaning (when TRUE)
0TO_OFFNORMALTransition into an off-normal event state
1TO_FAULTTransition into a fault event state
2TO_NORMALTransition back to the normal state

Primary uses:

  • Event_Enable property - which transitions should generate notifications
  • Acked_Transitions - which transitions still require operator acknowledgment
  • Various alarm/event summary services and notification parameters

The bit positions and semantics are identical for intrinsic reporting, algorithmic reporting, and all the summary/notification services.

BACnet Specification References

  • ASN.1 (Clause 21): BACnetEventTransitionBits ::= BIT STRING { to-offnormal (0), to-fault (1), to-normal (2) }
  • Object properties (Clause 12): event_enable, acked_transitions, event_time_stamps, etc.
  • Services: GetAlarmSummary, GetEventInformation, Confirmed/UnconfirmedEventNotification.

Examples (Doc Test)

iex> bits = %EventTransitionBits{to_offnormal: true, to_fault: true, to_normal: false}
iex> bits.to_offnormal
true

See Also

Summary

Types

t()

Represents a bit string indicating which event state transitions are of interest (to-offnormal, to-fault, to-normal).

Functions

Encodes a BACnet event transition bits into application tags encoding.

Creates from an application tag bitstring an event transition bits.

Parses a BACnet event transition bits from application tags encoding.

Creates an application tag bitstring from an event transition bits.

Validates whether the given event transition bits is in form valid.

Types

t()

@type t() :: %BACnet.Protocol.EventTransitionBits{
  to_fault: boolean(),
  to_normal: boolean(),
  to_offnormal: boolean()
}

Represents a bit string indicating which event state transitions are of interest (to-offnormal, to-fault, to-normal).

Functions

encode(flags, opts \\ [])

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

Encodes a BACnet event transition bits into application tags encoding.

from_bitstring(bitstring)

@spec from_bitstring(tuple()) :: t()

Creates from an application tag bitstring an event transition bits.

parse(tags)

Parses a BACnet event transition bits from application tags encoding.

to_bitstring(t)

Creates an application tag bitstring from an event transition bits.

valid?(t)

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

Validates whether the given event transition bits is in form valid.

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