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

Copy Markdown View Source

An Event Log Record is the structure stored by an Event Log object every time it receives (or generates) an event notification. It captures the timestamp, the full Confirmed Event Notification that was processed, the log status or any time change, at the moment the record was created.

Event logs are the BACnet equivalent of an alarm and event journal. They provide a time-stamped history of every significant event that occurred in the system, which is invaluable for post-incident analysis, regulatory compliance, and troubleshooting. Because the original notification is stored verbatim (including all parameters and source information), a later review can see exactly what the alarming object reported.

Summary

Types

t()

Represents a single record stored in an Event Log object.

Functions

Encode a BACnet log record into application tag-encoded.

Parse a BACnet event log record from application tags encoding.

Validates whether the given event log record is in form valid.

Types

t()

@type t() :: %BACnet.Protocol.EventLogRecord{
  log_datum:
    BACnet.Protocol.LogStatus.t()
    | BACnet.Protocol.Services.ConfirmedEventNotification.t()
    | {:time_change, float()},
  timestamp: BACnet.Protocol.BACnetDateTime.t()
}

Represents a single record stored in an Event Log object.

Functions

encode(record, opts \\ [])

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

Encode a BACnet log record into application tag-encoded.

parse(tags)

Parse a BACnet event log record from application tags encoding.

valid?(t)

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

Validates whether the given event log record is in form valid.

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