BACnet Result Flags is a three-bit bit string returned by range-reading services (ReadRange, GetEventInformation, etc.) to describe the window of data that was actually returned.
Bit meanings (MSB first):
| Bit | Name | Meaning when TRUE |
|---|---|---|
| 0 | FIRST_ITEM | Response contains the first (oldest) item of the requested range |
| 1 | LAST_ITEM | Response contains the last (newest) item of the requested range |
| 2 | MORE_ITEMS | More items matched but could not fit in this PDU / segment |
The flags allow a client to know whether it has the beginning, the end, or is looking at a slice in the middle of a potentially large collection (trend-log buffer, alarm summary, event log, etc.).
BACnet Specification References
- ASN.1 (Clause 21):
BACnetResultFlags ::= BIT STRING { first-item (0), last-item (1), more-items (2) } - Primary services: ReadRange-ACK (15.8), GetEventInformation-ACK (13.11), and several alarm/event summary acknowledgments.
Examples (Doc Test)
iex> flags = %ResultFlags{first_item: true, last_item: false, more_items: true}
iex> flags.more_items
trueSee Also
BACnet.Protocol.ReadRange
Summary
Functions
Encodes a BACnet result flags into application tags encoding.
Creates from an application tag bitstring a result flags.
Parses a BACnet result flags from application tags encoding.
Creates an application tag bitstring from a result flags.
Validates whether the given result flags is in form valid.
Types
Functions
@spec encode(t(), Keyword.t()) :: {:ok, BACnet.Protocol.ApplicationTags.encoding_list()} | {:error, term()}
Encodes a BACnet result flags into application tags encoding.
Creates from an application tag bitstring a result flags.
@spec parse(BACnet.Protocol.ApplicationTags.encoding_list()) :: {:ok, {t(), rest :: BACnet.Protocol.ApplicationTags.encoding_list()}} | {:error, term()}
Parses a BACnet result flags from application tags encoding.
@spec to_bitstring(t()) :: BACnet.Protocol.ApplicationTags.primitive_encoding()
Creates an application tag bitstring from a result flags.
Validates whether the given result flags is in form valid.
It only validates the struct is valid as per type specification.