pub trait BACnetObject: Send + Sync {
// Required methods
fn object_identifier(&self) -> ObjectIdentifier;
fn object_name(&self) -> &str;
fn read_property(
&self,
property: PropertyIdentifier,
array_index: Option<u32>,
) -> Result<PropertyValue, Error>;
fn write_property(
&mut self,
property: PropertyIdentifier,
array_index: Option<u32>,
value: PropertyValue,
priority: Option<u8>,
) -> Result<(), Error>;
fn property_list(&self) -> Cow<'static, [PropertyIdentifier]>;
// Provided methods
fn required_properties(&self) -> Cow<'static, [PropertyIdentifier]> { ... }
fn cov_increment(&self) -> Option<f32> { ... }
fn evaluate_intrinsic_reporting(&mut self) -> Option<EventStateChange> { ... }
fn tick_schedule(
&mut self,
_day_of_week: u8,
_hour: u8,
_minute: u8,
) -> Option<(PropertyValue, Vec<(ObjectIdentifier, u32)>)> { ... }
fn acknowledge_alarm(&mut self, _transition_bit: u8) -> Result<(), Error> { ... }
fn add_trend_record(&mut self, _record: BACnetLogRecord) { ... }
}Expand description
The core trait for all BACnet objects.
Implementors represent a single BACnet object (Device, AnalogInput, etc.) and provide read/write access to their properties.
Required Methods§
Sourcefn object_identifier(&self) -> ObjectIdentifier
fn object_identifier(&self) -> ObjectIdentifier
The object’s identifier (type + instance).
Sourcefn object_name(&self) -> &str
fn object_name(&self) -> &str
The object’s name.
Sourcefn read_property(
&self,
property: PropertyIdentifier,
array_index: Option<u32>,
) -> Result<PropertyValue, Error>
fn read_property( &self, property: PropertyIdentifier, array_index: Option<u32>, ) -> Result<PropertyValue, Error>
Read a property value.
Sourcefn write_property(
&mut self,
property: PropertyIdentifier,
array_index: Option<u32>,
value: PropertyValue,
priority: Option<u8>,
) -> Result<(), Error>
fn write_property( &mut self, property: PropertyIdentifier, array_index: Option<u32>, value: PropertyValue, priority: Option<u8>, ) -> Result<(), Error>
Write a property value.
Sourcefn property_list(&self) -> Cow<'static, [PropertyIdentifier]>
fn property_list(&self) -> Cow<'static, [PropertyIdentifier]>
List all properties this object supports.
Provided Methods§
Sourcefn required_properties(&self) -> Cow<'static, [PropertyIdentifier]>
fn required_properties(&self) -> Cow<'static, [PropertyIdentifier]>
List the REQUIRED properties for this object type.
Default returns the four universal required properties per Clause 12.11. Object implementations may override to include type-specific required properties.
Sourcefn cov_increment(&self) -> Option<f32>
fn cov_increment(&self) -> Option<f32>
COV increment for this object (analog objects only).
Returns Some(increment) for objects that use COV_Increment filtering
(e.g., AnalogInput, AnalogOutput, AnalogValue). A notification fires only
when |current_value - last_notified_value| >= increment.
Returns None for objects that notify on any state change (binary, multi-state).
Sourcefn evaluate_intrinsic_reporting(&mut self) -> Option<EventStateChange>
fn evaluate_intrinsic_reporting(&mut self) -> Option<EventStateChange>
Evaluate intrinsic reporting after a present_value change.
Returns Some(EventStateChange) if the event state transitioned,
or None if no change occurred (or the object doesn’t support intrinsic reporting).
Sourcefn tick_schedule(
&mut self,
_day_of_week: u8,
_hour: u8,
_minute: u8,
) -> Option<(PropertyValue, Vec<(ObjectIdentifier, u32)>)>
fn tick_schedule( &mut self, _day_of_week: u8, _hour: u8, _minute: u8, ) -> Option<(PropertyValue, Vec<(ObjectIdentifier, u32)>)>
Evaluate this object’s schedule for the given time (Clause 12.24).
Returns Some((new_value, refs)) if the present value changed, where refs
is the list of (object_identifier, property_identifier) pairs to write to.
Only meaningful for Schedule objects; default returns None.
Sourcefn acknowledge_alarm(&mut self, _transition_bit: u8) -> Result<(), Error>
fn acknowledge_alarm(&mut self, _transition_bit: u8) -> Result<(), Error>
Acknowledge an alarm transition. Sets the corresponding bit in acked_transitions. Returns Ok(()) if the object supports event detection, Err otherwise.
Sourcefn add_trend_record(&mut self, _record: BACnetLogRecord)
fn add_trend_record(&mut self, _record: BACnetLogRecord)
Add a trend log record (only meaningful for TrendLog / TrendLogMultiple).
Default is a no-op. TrendLog objects override to append to their buffer.