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

Copy Markdown View Source

An Action Command is one step inside an Action List that belongs to a Command object. When the Command object is activated (by writing to its present value), the device executes the sequence of Action Commands in order.

Each command can write a new value to any property of any object in the same device (or, via the Write Property service, to objects in other devices). The command may also specify a delay after the write occurs, a priority to use for commandable properties, and a "post-write" action that determines what the Command object should do after the write fails (quit or continue to the next action).

Summary

Types

t()

Represents a single action command within an Action List of a Command object.

Functions

Encode a BACnet action command into application tag-encoded.

Parse a BACnet action command from application tags encoding.

Validates whether the given action command is in form valid.

Types

t()

@type t() :: %BACnet.Protocol.ActionCommand{
  device_identifier: BACnet.Protocol.ObjectIdentifier.t() | nil,
  object_identifier: BACnet.Protocol.ObjectIdentifier.t(),
  post_delay: non_neg_integer() | nil,
  priority: 1..16 | nil,
  property_array_index: non_neg_integer() | nil,
  property_identifier:
    BACnet.Protocol.Constants.property_identifier() | non_neg_integer(),
  property_value: BACnet.Protocol.ApplicationTags.Encoding.t(),
  quit_on_failure: boolean(),
  write_successful: boolean()
}

Represents a single action command within an Action List of a Command object.

It describes a property write operation, including optional priority, post-delay, and quit-on-failure behavior.

Functions

encode(cmd, opts \\ [])

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

Encode a BACnet action command into application tag-encoded.

parse(tags)

Parse a BACnet action command from application tags encoding.

valid?(t)

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

Validates whether the given action command is in form valid.

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