pub struct EventLogObject { /* private fields */ }Expand description
BACnet EventLog object.
Ring buffer of timestamped event log records. A server running the
database logs the event notifications the device builds into its Event
Logs (ObjectDatabase::log_event_notification), and those it receives
into the logs that opt in with
set_log_received_notifications;
the application calls add_record() for anything else, such as a clock
change. The log adds its own status records. Records are kept only while
Enable is TRUE and the local time lies between Start_Time and Stop_Time;
the database’s trend poller looks at that window on every pass, so an
opening or closing is recorded even when no record arrives.
The log reports intrinsically with the BUFFER_READY algorithm (Clause 13.3.7): once Notification_Threshold is set, the server tells the recipients of its Notification Class each time that many more records have been collected. No log takes a record for such a report.
Implementations§
Source§impl EventLogObject
impl EventLogObject
Sourcepub fn new(
instance: u32,
name: impl Into<String>,
buffer_size: u32,
) -> Result<Self, Error>
pub fn new( instance: u32, name: impl Into<String>, buffer_size: u32, ) -> Result<Self, Error>
Create a new EventLog object.
Sourcepub fn add_record(&mut self, record: BACnetEventLogRecord) -> Result<(), Error>
pub fn add_record(&mut self, record: BACnetEventLogRecord) -> Result<(), Error>
Add a record to the event log buffer.
The record is kept as given; ReadRange serves its encoding, which for
an ACK_NOTIFICATION leaves out ack-required, from-state and event
values (see EventLogDatum::Notification).
Success does not guarantee a resident ordinary record: disabled logging and a record outside the Start_Time / Stop_Time window are ignored, zero-capacity logging may only count, and a stop-before-full transition records status instead. Missing/invalid status clocks fail atomically with DEVICE / OPERATIONAL_PROBLEM.
Sourcepub fn records(&self) -> &VecDeque<BACnetEventLogRecord>
pub fn records(&self) -> &VecDeque<BACnetEventLogRecord>
Get the current buffer contents.
Sourcepub fn total_record_count(&self) -> u32
pub fn total_record_count(&self) -> u32
Total_Record_Count, as
TrendLogObject::total_record_count
serves it.
Sourcepub fn restore_log_buffer(
&mut self,
total_record_count: u32,
records: impl IntoIterator<Item = BACnetEventLogRecord>,
) -> Result<(), Error>
pub fn restore_log_buffer( &mut self, total_record_count: u32, records: impl IntoIterator<Item = BACnetEventLogRecord>, ) -> Result<(), Error>
Restore the log buffer, or seed Total_Record_Count with no records,
before the log is added to an ObjectDatabase, under the rules of
TrendLogObject::restore_log_buffer
(#1537). After a restart, follow it with
record_interruption, which counts
toward Total_Record_Count.
Sourcepub fn record_interruption(
&mut self,
date: Date,
time: Time,
) -> Result<(), Error>
pub fn record_interruption( &mut self, date: Date, time: Time, ) -> Result<(), Error>
Append a LOG_INTERRUPTED status record, as
TrendLogObject::record_interruption
does, after restoring the log on a restart (#1537).
Sourcepub fn set_description(&mut self, desc: impl Into<String>)
pub fn set_description(&mut self, desc: impl Into<String>)
Set the description string.
Sourcepub fn set_start_time(&mut self, date: Date, time: Time) -> Result<(), Error>
pub fn set_start_time(&mut self, date: Date, time: Time) -> Result<(), Error>
Set Start_Time, the local date and time from which records are kept, as local configuration: nothing is recorded for the change itself, but the log notes at once where the window stands, so a client’s write that then opens or shuts it is recorded. Every field unspecified leaves the start open. Any other value has to name an actual date and time, or it is PROPERTY / VALUE_OUT_OF_RANGE: the weekday may stay unspecified, and unspecified seconds or hundredths count as zero.
Sourcepub fn set_stop_time(&mut self, date: Date, time: Time) -> Result<(), Error>
pub fn set_stop_time(&mut self, date: Date, time: Time) -> Result<(), Error>
Set Stop_Time, the local date and time from which records are no
longer kept, under the same rules as
set_start_time.
Sourcepub fn logs_received_notifications(&self) -> bool
pub fn logs_received_notifications(&self) -> bool
Whether the log takes the event notifications the device receives, as well as those it builds. Off unless set.
Sourcepub fn set_log_received_notifications(&mut self, log: bool)
pub fn set_log_received_notifications(&mut self, log: bool)
Have the log take the Confirmed and UnconfirmedEventNotifications the
device receives, unicast or broadcast, each kept as it decoded, or
stop it doing so. Clause 12.27 leaves the choice to the device, and
it’s off by default. A running server holds what it logs to a small
number of records per source each second; see
ObjectDatabase::log_received_event_notification.
Sourcepub fn set_notification_threshold(&mut self, threshold: u32)
pub fn set_notification_threshold(&mut self, threshold: u32)
Set Notification_Threshold, the number of records that makes a BUFFER_READY report; zero, the default, makes none.
Sourcepub fn set_notification_class(&mut self, class: u32)
pub fn set_notification_class(&mut self, class: u32)
Set Notification_Class: the number of the Notification Class whose recipients get the log’s reports (0 by default).
Sourcepub fn set_event_enable(&mut self, enable: EventTransitionBits)
pub fn set_event_enable(&mut self, enable: EventTransitionBits)
Set Event_Enable; a report goes out only while its TO_NORMAL flag is set, as it is by default.
Sourcepub fn set_notify_type(&mut self, notify_type: NotifyType)
pub fn set_notify_type(&mut self, notify_type: NotifyType)
Set Notify_Type, sent with each report (EVENT by default).
Trait Implementations§
Source§impl BACnetObject for EventLogObject
impl BACnetObject for EventLogObject
Source§fn object_identifier(&self) -> ObjectIdentifier
fn object_identifier(&self) -> ObjectIdentifier
Source§fn object_name(&self) -> &str
fn object_name(&self) -> &str
Source§fn 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>
Source§fn 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>
Source§fn property_metadata(&self) -> Cow<'_, [PropertyMetadata]>
fn property_metadata(&self) -> Cow<'_, [PropertyMetadata]>
Source§fn property_list(&self) -> Cow<'static, [PropertyIdentifier]>
fn property_list(&self) -> Cow<'static, [PropertyIdentifier]>
Source§fn log_record_identities_internal(&self) -> Option<Vec<LogRecordIdentity>>
fn log_record_identities_internal(&self) -> Option<Vec<LogRecordIdentity>>
Source§fn log_buffer_internal(&self) -> Option<&dyn LogBufferRecords>
fn log_buffer_internal(&self) -> Option<&dyn LogBufferRecords>
Source§fn add_event_log_record(
&mut self,
record: BACnetEventLogRecord,
) -> Result<(), Error>
fn add_event_log_record( &mut self, record: BACnetEventLogRecord, ) -> Result<(), Error>
Source§fn evaluate_intrinsic_reporting(&mut self) -> Option<TransitionOutcome>
fn evaluate_intrinsic_reporting(&mut self) -> Option<TransitionOutcome>
Source§fn tick_intrinsic_reporting(&mut self) -> Option<TransitionOutcome>
fn tick_intrinsic_reporting(&mut self) -> Option<TransitionOutcome>
Time_Delay countdown for a pending transition. Read moreSource§fn write_property_from(
&mut self,
property: PropertyIdentifier,
array_index: Option<u32>,
value: PropertyValue,
priority: Option<u8>,
_origin: &CommandOrigin,
) -> Result<(), Error>
fn write_property_from( &mut self, property: PropertyIdentifier, array_index: Option<u32>, value: PropertyValue, priority: Option<u8>, _origin: &CommandOrigin, ) -> Result<(), Error>
Source§fn is_writable_property(&self, property: PropertyIdentifier) -> bool
fn is_writable_property(&self, property: PropertyIdentifier) -> bool
property for this object. Read moreSource§fn is_array_property(&self, property: PropertyIdentifier) -> bool
fn is_array_property(&self, property: PropertyIdentifier) -> bool
property accepts an array index on this object. Read moreSource§fn is_list_property(&self, property: PropertyIdentifier) -> bool
fn is_list_property(&self, property: PropertyIdentifier) -> bool
property is a BACnetLIST on this object. Read moreSource§fn is_createable(&self) -> bool
fn is_createable(&self) -> bool
Source§fn creation_only_properties(&self) -> &'static [PropertyIdentifier]
fn creation_only_properties(&self) -> &'static [PropertyIdentifier]
Source§fn initialize_property(
&mut self,
_property: PropertyIdentifier,
_value: PropertyValue,
) -> Result<(), Error>
fn initialize_property( &mut self, _property: PropertyIdentifier, _value: PropertyValue, ) -> Result<(), Error>
Self::creation_only_properties, written whole. Read moreSource§fn is_deleteable(&self) -> bool
fn is_deleteable(&self) -> bool
Source§fn required_properties(&self) -> Cow<'static, [PropertyIdentifier]>
fn required_properties(&self) -> Cow<'static, [PropertyIdentifier]>
Source§fn supports_cov(&self) -> bool
fn supports_cov(&self) -> bool
Source§fn supports_subscribe_cov_property(&self) -> bool
fn supports_subscribe_cov_property(&self) -> bool
Source§fn supports_cov_property(&self, property: PropertyIdentifier) -> bool
fn supports_cov_property(&self, property: PropertyIdentifier) -> bool
Source§fn cov_increment(&self) -> Option<f64>
fn cov_increment(&self) -> Option<f64>
Source§fn cov_reported_properties(&self) -> &'static [CovReportedProperty]
fn cov_reported_properties(&self) -> &'static [CovReportedProperty]
Source§fn set_overridden(&mut self, _overridden: bool)
fn set_overridden(&mut self, _overridden: bool)
Source§fn tick_schedule(
&mut self,
_today: SpecificDate,
_time: Time,
_calendar_active: &dyn Fn(ObjectIdentifier) -> bool,
) -> Option<ScheduleWrite>
fn tick_schedule( &mut self, _today: SpecificDate, _time: Time, _calendar_active: &dyn Fn(ObjectIdentifier) -> bool, ) -> Option<ScheduleWrite>
Source§fn take_owed_schedule_writes(&mut self) -> Vec<ScheduleWrite>
fn take_owed_schedule_writes(&mut self) -> Vec<ScheduleWrite>
Source§fn complete_schedule_write(
&mut self,
_write: &ScheduleWrite,
_outcomes: &[ScheduleTargetOutcome],
) -> bool
fn complete_schedule_write( &mut self, _write: &ScheduleWrite, _outcomes: &[ScheduleTargetOutcome], ) -> bool
write, one of this schedule’s writes:
outcomes holds one entry per member of write.references, in order. Read moreSource§fn retry_refusals_naming(
&self,
_target: ObjectIdentifier,
) -> Option<ScheduleWrite>
fn retry_refusals_naming( &self, _target: ObjectIdentifier, ) -> Option<ScheduleWrite>
retry of the current value to the
references whose last write was refused and that name target, an
object just added to the database (#1440), so the refusal can clear
without waiting for the next pass. None when no such refusal
stands, or when the pass itself would retry nothing: out of service,
outside Effective_Period, or with a NULL Present_Value. Only
meaningful for Schedule objects; default returns None.Source§fn acknowledge_alarm(
&mut self,
_transition_bit: EventTransitionBits,
) -> Result<(), Error>
fn acknowledge_alarm( &mut self, _transition_bit: EventTransitionBits, ) -> Result<(), Error>
transition_bit flags in acked_transitions.
Returns Ok(()) if the object supports event detection, Err otherwise.Source§fn apply_life_safety_operation(
&mut self,
_operation: LifeSafetyOperation,
) -> Result<LifeSafetyOperationOutcome, Error>
fn apply_life_safety_operation( &mut self, _operation: LifeSafetyOperation, ) -> Result<LifeSafetyOperationOutcome, Error>
Source§fn set_life_safety_operation_expected_internal(
&mut self,
_operation: LifeSafetyOperation,
) -> Result<(), Error>
fn set_life_safety_operation_expected_internal( &mut self, _operation: LifeSafetyOperation, ) -> Result<(), Error>
Source§fn set_event_state_internal(&mut self, _state: EventState) -> Result<(), Error>
fn set_event_state_internal(&mut self, _state: EventState) -> Result<(), Error>
Event_State transition. Read moreSource§fn enrollment_eval_state_internal(&self) -> Option<EventEnrollmentEvalState>
fn enrollment_eval_state_internal(&self) -> Option<EventEnrollmentEvalState>
Source§fn set_enrollment_eval_state_internal(
&mut self,
_state: EventEnrollmentEvalState,
) -> Result<(), Error>
fn set_enrollment_eval_state_internal( &mut self, _state: EventEnrollmentEvalState, ) -> Result<(), Error>
Source§fn enrollment_eval_source_internal(
&self,
) -> Option<Option<EventEnrollmentMonitoredSource>>
fn enrollment_eval_source_internal( &self, ) -> Option<Option<EventEnrollmentMonitoredSource>>
Source§fn set_enrollment_eval_source_internal(
&mut self,
_source: Option<EventEnrollmentMonitoredSource>,
) -> Result<(), Error>
fn set_enrollment_eval_source_internal( &mut self, _source: Option<EventEnrollmentMonitoredSource>, ) -> Result<(), Error>
Source§fn set_acked_transitions_internal(
&mut self,
_transition_bit: EventTransitionBits,
_acknowledged: bool,
) -> Result<(), Error>
fn set_acked_transitions_internal( &mut self, _transition_bit: EventTransitionBits, _acknowledged: bool, ) -> Result<(), Error>
Acked_Transitions bit on a received event-state
transition. Read moreSource§fn evaluate_reliability_internal(
&mut self,
) -> Result<ReliabilityEvaluation, Error>
fn evaluate_reliability_internal( &mut self, ) -> Result<ReliabilityEvaluation, Error>
Reliability. Read moreSource§fn set_reliability_internal(
&mut self,
_reliability: Reliability,
) -> Result<(), Error>
fn set_reliability_internal( &mut self, _reliability: Reliability, ) -> Result<(), Error>
Reliability value. Read moreSource§fn set_present_value_internal(
&mut self,
_value: PropertyValue,
) -> Result<(), Error>
fn set_present_value_internal( &mut self, _value: PropertyValue, ) -> Result<(), Error>
Present_Value supplied by the local application. Read moreSource§fn set_present_value_from_internal(
&mut self,
value: PropertyValue,
_origin: &CommandOrigin,
) -> Result<(), Error>
fn set_present_value_from_internal( &mut self, value: PropertyValue, _origin: &CommandOrigin, ) -> Result<(), Error>
Source§fn set_tracking_value_internal(
&mut self,
_value: PropertyValue,
) -> Result<(), Error>
fn set_tracking_value_internal( &mut self, _value: PropertyValue, ) -> Result<(), Error>
Tracking_Value the local application derived. Read moreSource§fn report_access_input_internal(
&mut self,
_input: AccessControlInput,
) -> Result<(), Error>
fn report_access_input_internal( &mut self, _input: AccessControlInput, ) -> Result<(), Error>
AccessControlInput. Read more