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

Copy Markdown View Source

BACnetNameValue is a structure used primarily for the Tags property (of type BACnetARRAY of BACnetNameValue) that exists on nearly every standardized BACnet object type (ASHRAE 135-2016 Clause 12.x and Annex Y).

Each entry associates a name (CharacterString) with an optional value. When the value is absent the tag is considered a "semantic tag". To allow tag names to be concatenated, tag names shall not contain semicolon characters (ASHRAE 135-2016 Y.1.4).

Simple tag names, e.g., exhaust, are reserved for definition by ASHRAE. Tag names defined by organizations other than ASHRAE shall use a prefix to ensure uniqueness. This prefix shall be either:

  1. A reversed registered DNS name, followed by a period character. e.g., com.example., or
  2. A BACnet vendor identifier in decimal, followed by a dash character. e.g., 555-

The value, when present, is limited to any primitive BACnet datatype.

ASN.1 (ASHRAE 135-2016)

BACnetNameValue ::= SEQUENCE {
  name  [0] CharacterString,
  value ABSTRACT-SYNTAX.&Type OPTIONAL
    -- value is limited to primitive datatypes
}

Summary

Types

t()

A single BACnetNameValue entry.

Functions

Encodes a BACnetNameValue into application tags encoding.

Parses a BACnetNameValue from application tags encoding (context tagged elements).

Returns true if the NameValue struct contains a valid name and (optionally) a well-formed value of a supported type.

Types

t()

@type t() :: %BACnet.Protocol.NameValue{
  name: String.t(),
  value: BACnet.Protocol.ApplicationTags.Encoding.t() | nil
}

A single BACnetNameValue entry.

Only primitive Encoding is allowed as value, otherwise the value is absent (nil).

Functions

encode(name_value, opts \\ [])

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

Encodes a BACnetNameValue into application tags encoding.

parse(tags)

Parses a BACnetNameValue from application tags encoding (context tagged elements).

valid?(t)

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

Returns true if the NameValue struct contains a valid name and (optionally) a well-formed value of a supported type.