BACnet.Protocol.BACnetError (bacstack v0.0.1)

View Source

Summary

Types

t()

Represents a casual BACnet Error.

Functions

Encodes a BACnet error into BACnet application tags encoding.

Parses a BACnet error from BACnet application tags encoding.

Validates whether the given status flags is in form valid.

Types

t()

@type t() :: %BACnet.Protocol.BACnetError{
  class: BACnet.Protocol.Constants.error_class() | non_neg_integer(),
  code: BACnet.Protocol.Constants.error_code() | non_neg_integer()
}

Represents a casual BACnet Error.

To allow forward compatibility, each field can be an integer.

Functions

encode(error, opts \\ [])

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

Encodes a BACnet error into BACnet application tags encoding.

parse(tags)

Parses a BACnet error from BACnet application tags encoding.

valid?(t)

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

Validates whether the given status flags is in form valid.

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