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

Copy Markdown View Source

An Object Property Reference is the most common way to name a specific property of a specific object in BACnet. It consists of an Object Identifier, a Property Identifier (which may be a standard named property or a vendor-specific numeric identifier), and an optional array index when the property is an array.

This type is used everywhere a service or object needs to refer to a property that may live in another object or even another device: in Read Property and Write Property requests, inside the monitored values of COV subscriptions, in the log device object property list of Trend Log Multiple objects, in event parameters that reference other properties for comparison, and in many more places.

Examples (Doc Test)

iex> ref = %ObjectPropertyRef{
...>   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, optionally an array element, of an object.

Functions

Encodes a BACnet object property reference into application tags encoding.

Parses a BACnet object property reference into a struct.

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

Types

t()

@type t() :: %BACnet.Protocol.ObjectPropertyRef{
  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, optionally an array element, of an object.

Functions

encode(ref, opts \\ [])

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

Encodes a BACnet object property reference into application tags encoding.

parse(tags)

Parses a BACnet object property reference into a struct.

valid?(t)

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

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

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