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

Copy Markdown View Source

Log Status is a compact three-bit bit string that reports the operational state of a Trend Log or Event Log object. The three bits respectively indicate whether logging has been disabled by the Log_Enable property, whether the internal buffer has been purged since the last notification, and whether logging was interrupted (for example because of a power failure or a configuration change).

These status bits are returned as part of the Log Status property and are also included in the log record that is sent when a client reads the log or when the log autonomously sends a notification. They allow a receiving system to know whether the data it is seeing is complete or whether there are gaps that must be taken into account when performing analysis or generating reports.

Examples (Doc Test)

iex> status = %LogStatus{log_disabled: false, buffer_purged: true, log_interrupted: false}
iex> status.buffer_purged
true

Summary

Types

t()

Represents the status of a log (Trend Log or Event Log).

Functions

Encodes a BACnet log status into application tags encoding.

Creates from an application tag bitstring a log status.

Parses a BACnet log status from application tags encoding.

Creates an application tag bitstring from a log status.

Validates whether the given log status is in form valid.

Types

t()

@type t() :: %BACnet.Protocol.LogStatus{
  buffer_purged: boolean(),
  log_disabled: boolean(),
  log_interrupted: boolean()
}

Represents the status of a log (Trend Log or Event Log).

Functions

encode(flags, opts \\ [])

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

Encodes a BACnet log status into application tags encoding.

from_bitstring(bitstring)

@spec from_bitstring({boolean(), boolean()} | {boolean(), boolean(), boolean()}) ::
  t()

Creates from an application tag bitstring a log status.

parse(tags)

Parses a BACnet log status from application tags encoding.

to_bitstring(t)

Creates an application tag bitstring from a log status.

valid?(t)

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

Validates whether the given log status is in form valid.

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