A Time Value is the atomic (time, value) pair used inside BACnet.Protocol.DailySchedule
entries. It says: "at (or after) this time, the scheduled property should
take on this value".
The value is stored as a raw ApplicationTags.Encoding so it can carry
any datatype the target property accepts (real, enumerated, boolean, etc.).
BACnet Specification References
- ASN.1 (Clause 21):
BACnetTimeValue ::= SEQUENCE { time Time, value ABSTRACT-SYNTAX.&Type } - Used in
BACnet.Protocol.DailySchedule.dayScheduleand therefore in both normal weekly schedules and special-event overrides (Schedule object, Clause 12.24).
Examples (Doc Test)
iex> tv = %TimeValue{time: %BACnetTime{hour: 8, minute: 0, second: 0, hundredth: 0}, value: {:real, 22.5}}
iex> tv.value
{:real, 22.5}See Also
Summary
Functions
Encodes a BACnet time value into BACnet application tags encoding.
Parses a BACnet time value from BACnet application tags encoding.
Validates whether the given time value is in form valid.
Types
@type t() :: %BACnet.Protocol.TimeValue{ time: BACnet.Protocol.BACnetTime.t(), value: BACnet.Protocol.ApplicationTags.Encoding.t() }
(time, value) pair for schedules. value is generic ApplicationTags encoding.
Functions
@spec encode(t(), Keyword.t()) :: {:ok, BACnet.Protocol.ApplicationTags.encoding_list()} | {:error, term()}
Encodes a BACnet time value into BACnet application tags encoding.
@spec parse(BACnet.Protocol.ApplicationTags.encoding_list()) :: {:ok, {t(), rest :: BACnet.Protocol.ApplicationTags.encoding_list()}} | {:error, term()}
Parses a BACnet time value from BACnet application tags encoding.
Validates whether the given time value is in form valid.
It only validates the struct is valid as per type specification.