bacnet_types/constructed/property_value.rs
1//! A property value with its reference and write priority
2//! (`BACnetPropertyValue`, Clause 21): the element of WritePropertyMultiple,
3//! CreateObject and COV notification lists, and of a complex event type's
4//! notification values.
5
6#[cfg(not(feature = "std"))]
7use alloc::vec::Vec;
8
9use crate::enums::PropertyIdentifier;
10
11/// BACnetPropertyValue (Clause 21.6).
12///
13/// Four context-tagged members in order: property identifier `[0]`, an optional Unsigned array
14/// index `[1]`, the value inside an opening/closing `[2]` pair (typed by the property), and an
15/// optional priority `[3]`, an Unsigned limited to 1-16.
16///
17/// The `value` field contains raw application-tagged bytes. The application
18/// layer interprets the value based on the property type.
19#[derive(Debug, Clone, PartialEq, Eq)]
20pub struct BACnetPropertyValue {
21 /// Property being reported.
22 pub property_identifier: PropertyIdentifier,
23 /// Array element index; `None` means the whole property.
24 pub property_array_index: Option<u32>,
25 /// Property value as encoded BACnet bytes, without the surrounding `[2]` context tags.
26 pub value: Vec<u8>,
27 /// Write priority (1-16); `None` when absent.
28 pub priority: Option<u8>,
29}