BACnet.Protocol.WeekNDay (bacstack v0.0.1)
View SourceSummary
Functions
Encodes a BACnet week and day into application tags encoding.
Parses a BACnet week and day from application tags encoding.
Validates whether the given BACnet week and day is in form valid.
Types
@type t() :: %BACnet.Protocol.WeekNDay{
month: 1..12 | :even | :odd | :unspecified,
week_of_month: 1..6 | :unspecified,
weekday: 1..7 | :unspecified
}
Represents a BACnet Week And Day, which can have unspecified (= any) or even/odd values.
Week of month specifies which week of the month:
1
- Days numbered 1-72
- Days numbered 8-143
- Days numbered 15-214
- Days numbered 22-285
- Days numbered 29-316
- Last 7 days of this month
Weekday specifies the day of the week, starting with monday to sunday (1-7).
Functions
@spec encode(t(), Keyword.t()) :: {:ok, BACnet.Protocol.ApplicationTags.encoding_list()} | {:error, term()}
Encodes a BACnet week and day into application tags encoding.
@spec parse(BACnet.Protocol.ApplicationTags.encoding_list()) :: {:ok, {t(), rest :: BACnet.Protocol.ApplicationTags.encoding_list()}} | {:error, term()}
Parses a BACnet week and day from application tags encoding.
Validates whether the given BACnet week and day is in form valid.
It only validates the struct is valid as per type specification.