Skip to main content

Module bitstring

Module bitstring 

Source
Expand description

Named BACnet bit-string types (ASHRAE 135-2020 Clause 21).

Several properties carry a BitString whose bits have a fixed, named meaning defined by the standard. This module models those BACnetXxx BIT STRING productions so a decoded crate::primitives::PropertyValue::BitString can be promoted from raw (unused_bits, data) bytes to named flags, the same way crate::enums::ResolvedEnum promotes an Enumerated.

§Bit order

BACnet bit strings are transmitted most-significant-bit-first: bit 0 of the string is the top bit (0x80) of the first content byte, bit 8 is the top bit of the second byte, and so on. Every type here reads bit N of the string as “feature N”, matching how the device object packs these fields (see bacnet-objects’s compute_object_types_supported).

crate::primitives::StatusFlags predates this module and keeps its own right-aligned representation; it is re-exported and mapped by the resolver as well.

Re-exports§

pub use crate::primitives::StatusFlags;

Structs§

AuditOperationFlags
BACnetAuditOperationFlags — a bit string selecting audit operations (Clause 21).
BACnetPriorityFilter
BACnetPriorityFilter — one bit for each command priority from 1 through 16.
DaysOfWeek
BACnetDaysOfWeek — 7-bit string with one bit per weekday, Monday first (Clause 21). A BACnetDestination uses it as valid-days.
EventTransitionBits
BACnetEventTransitionBits — 3-bit string for event-enable, acked-transitions, and ack-required (Clause 21).
LimitEnable
BACnetLimitEnable — 2-bit string for the limit-enable property (Clause 21).
LogStatus
BACnetLogStatus — the 3-bit string a log object records when its own status or operation changes (Clause 21).
ObjectTypesSupported
BACnetObjectTypesSupported — the protocol-object-types-supported bit string, one bit per object type (Clause 21).
ServicesSupported
BACnetServicesSupported — the protocol-services-supported bit string, one bit per protocol service (Clause 21).

Functions§

status_flags_from_bacnet
Decode a BACnetStatusFlags bit-string payload (MSB-first) into StatusFlags, which keeps its right-aligned in-memory layout.