Skip to main content

BACnetObject

Trait BACnetObject 

Source
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§

Source

fn object_identifier(&self) -> ObjectIdentifier

The object’s identifier (type + instance).

Source

fn object_name(&self) -> &str

The object’s name.

Source

fn read_property( &self, property: PropertyIdentifier, array_index: Option<u32>, ) -> Result<PropertyValue, Error>

Read a property value.

Source

fn write_property( &mut self, property: PropertyIdentifier, array_index: Option<u32>, value: PropertyValue, priority: Option<u8>, ) -> Result<(), Error>

Write a property value.

Source

fn property_list(&self) -> Cow<'static, [PropertyIdentifier]>

List all properties this object supports.

Provided Methods§

Source

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.

Source

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).

Source

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).

Source

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.

Source

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.

Source

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.

Implementors§

Source§

impl BACnetObject for AccessCredentialObject

Source§

impl BACnetObject for AccessDoorObject

Source§

impl BACnetObject for AccessPointObject

Source§

impl BACnetObject for AccessRightsObject

Source§

impl BACnetObject for AccessUserObject

Source§

impl BACnetObject for AccessZoneObject

Source§

impl BACnetObject for CredentialDataInputObject

Source§

impl BACnetObject for AccumulatorObject

Source§

impl BACnetObject for PulseConverterObject

Source§

impl BACnetObject for AnalogInputObject

Source§

impl BACnetObject for AnalogOutputObject

Source§

impl BACnetObject for AnalogValueObject

Source§

impl BACnetObject for AuditLogObject

Source§

impl BACnetObject for AuditReporterObject

Source§

impl BACnetObject for AveragingObject

Source§

impl BACnetObject for BinaryInputObject

Source§

impl BACnetObject for BinaryOutputObject

Source§

impl BACnetObject for BinaryValueObject

Source§

impl BACnetObject for CommandObject

Source§

impl BACnetObject for DeviceObject

Source§

impl BACnetObject for ElevatorGroupObject

Source§

impl BACnetObject for EscalatorObject

Source§

impl BACnetObject for LiftObject

Source§

impl BACnetObject for AlertEnrollmentObject

Source§

impl BACnetObject for EventEnrollmentObject

Source§

impl BACnetObject for EventLogObject

Source§

impl BACnetObject for FileObject

Source§

impl BACnetObject for NotificationForwarderObject

Source§

impl BACnetObject for GlobalGroupObject

Source§

impl BACnetObject for GroupObject

Source§

impl BACnetObject for StructuredViewObject

Source§

impl BACnetObject for LifeSafetyPointObject

Source§

impl BACnetObject for LifeSafetyZoneObject

Source§

impl BACnetObject for BinaryLightingOutputObject

Source§

impl BACnetObject for ChannelObject

Source§

impl BACnetObject for LightingOutputObject

Source§

impl BACnetObject for LoadControlObject

Source§

impl BACnetObject for LoopObject

Source§

impl BACnetObject for MultiStateInputObject

Source§

impl BACnetObject for MultiStateOutputObject

Source§

impl BACnetObject for MultiStateValueObject

Source§

impl BACnetObject for NetworkPortObject

Source§

impl BACnetObject for NotificationClass

Source§

impl BACnetObject for ProgramObject

Source§

impl BACnetObject for CalendarObject

Source§

impl BACnetObject for ScheduleObject

Source§

impl BACnetObject for StagingObject

Source§

impl BACnetObject for TimerObject

Source§

impl BACnetObject for TrendLogMultipleObject

Source§

impl BACnetObject for TrendLogObject

Source§

impl BACnetObject for BitStringValueObject

Source§

impl BACnetObject for CharacterStringValueObject

Source§

impl BACnetObject for DatePatternValueObject

Source§

impl BACnetObject for DateTimePatternValueObject

Source§

impl BACnetObject for DateTimeValueObject

Source§

impl BACnetObject for DateValueObject

Source§

impl BACnetObject for IntegerValueObject

Source§

impl BACnetObject for LargeAnalogValueObject

Source§

impl BACnetObject for OctetStringValueObject

Source§

impl BACnetObject for PositiveIntegerValueObject

Source§

impl BACnetObject for TimePatternValueObject

Source§

impl BACnetObject for TimeValueObject