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

Copy Markdown View Source

A Device Object Property Reference is the most complete form of property reference in BACnet. It identifies a specific property (with optional array index) inside a specific object, optionally qualified by the device that contains that object.

This type is used whenever a reference must be unambiguous across the entire BACnet internetwork. It appears in many event and fault parameters that monitor remote properties, inside the log device object property list of Trend Log (Multiple) objects, and in the various "reference" properties used by Schedule, Command, and other coordinating objects.

When device_identifier is nil, the reference is understood to be local to the device that contains the referring object.

Examples (Doc Test)

iex> ref = %DeviceObjectPropertyRef{
...>   device_identifier: %ObjectIdentifier{type: :device, instance: 42},
...>   object_identifier: %ObjectIdentifier{type: :analog_input, instance: 1},
...>   property_identifier: :present_value,
...>   property_array_index: nil
...> }
iex> ref.property_identifier
:present_value

Summary

Types

t()

References a specific property of an object, optionally qualified by the device containing that object.

Functions

Encodes a BACnet device object property reference into application tags encoding.

Parses a BACnet device object property reference into a struct.

Validates whether the given device object property reference is in form valid.

Types

t()

@type t() :: %BACnet.Protocol.DeviceObjectPropertyRef{
  device_identifier: BACnet.Protocol.ObjectIdentifier.t() | nil,
  object_identifier: BACnet.Protocol.ObjectIdentifier.t(),
  property_array_index: non_neg_integer() | nil,
  property_identifier:
    BACnet.Protocol.Constants.property_identifier() | non_neg_integer()
}

References a specific property of an object, optionally qualified by the device containing that object.

Functions

encode(ref, opts \\ [])

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

Encodes a BACnet device object property reference into application tags encoding.

parse(tags)

Parses a BACnet device object property reference into a struct.

valid?(t)

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

Validates whether the given device object property reference is in form valid.

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