Skip to main content

bacnet_client/client/
device_events.rs

1use super::*;
2
3impl<T: TransportPort + 'static> BACnetClient<T> {
4    /// Get a receiver for device discovery events. Each call returns a new
5    /// independent receiver.
6    ///
7    /// Events are notification-only; `discovered_devices()` remains the
8    /// authoritative snapshot of the current discovery table.
9    pub fn device_events(&self) -> broadcast::Receiver<DeviceEvent> {
10        self.device_tx.subscribe()
11    }
12
13    /// Get a receiver for Device-instance collision notifications. Each call
14    /// returns a new independent receiver.
15    ///
16    /// Delivery is notification-only and best-effort: receivers can lag and
17    /// missed notifications do not affect collision handling. The `retained`
18    /// snapshot identifies the discovery-table row that remains authoritative;
19    /// the conflicting `incoming` snapshot is not installed in the table.
20    pub fn device_collision_events(&self) -> broadcast::Receiver<DeviceCollisionEvent> {
21        self.device_collision_tx.subscribe()
22    }
23}