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

Copy Markdown View Source

A Group Channel Value is the payload element used by the Write Group service. It allows a single confirmed or unconfirmed request to command many objects at once by addressing them through a numeric "channel" rather than by object identifier.

Each entry specifies a channel number (0-65535), an optional overriding priority (used when writing to commandable properties), and the actual value to be written. The value may be a normal primitive or a specially encoded lightning command when the target objects are lighting output objects. The receiving device is responsible for mapping the channel number to one or more actual objects and performing the write on their behalf.

The Write Group service and this data type were introduced to support large scale lighting control and similar "mass command" use cases where sending thousands of individual Write Property requests would be impractical. A single Write Group message can affect hundreds of objects with very low network overhead.

Summary

Types

t()

Represents a single channel/value pair used by the Write Group service.

Functions

Encodes a group channel value struct into application tags encoding.

Parses a BACnet group channel value into a struct.

Validates whether the given BACnet group channel value is in form valid.

Types

t()

@type t() :: %BACnet.Protocol.GroupChannelValue{
  channel: BACnet.Protocol.ApplicationTags.unsigned16(),
  overriding_priority: 1..16 | nil,
  value:
    BACnet.Protocol.ApplicationTags.Encoding.t()
    | (lightning_command :: [BACnet.Protocol.ApplicationTags.Encoding.t()])
}

Represents a single channel/value pair used by the Write Group service.

Functions

encode(value, opts \\ [])

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

Encodes a group channel value struct into application tags encoding.

parse(tags)

Parses a BACnet group channel value into a struct.

valid?(t)

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

Validates whether the given BACnet group channel value is in form valid.

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