implement real-time d-bus signal subscriptions for modem state and signal quality.
modem state changes
subscribe to Modem.StateChanged(old: i32, new: i32, reason: u32) signal.
pub struct ModemStateChange {
pub modem_path: String,
pub old_state: ModemState,
pub new_state: ModemState,
pub reason: StateChangeReason,
}
pub async fn monitor_state(&self) -> Result<impl Stream<Item = ModemStateChange> + Send>;
follow the pattern in nmrs/src/monitoring/device.rs.
signal quality
poll SignalQuality property changes via PropertiesChanged signal, or use Modem.Signal interface if extended signal info is needed.
pub struct SignalUpdate {
pub modem_path: String,
pub quality: u32,
pub recent: bool,
pub access_technology: AccessTechnology,
}
pub async fn monitor_signal(&self) -> Result<impl Stream<Item = SignalUpdate> + Send>;
modem added/removed
subscribe to ObjectManager.InterfacesAdded / InterfacesRemoved on /org/freedesktop/ModemManager1 for hotplug detection.
pub enum ModemEvent {
Added(String), // modem path
Removed(String),
}
pub async fn monitor_modems(&self) -> Result<impl Stream<Item = ModemEvent> + Send>;
stream trait bounds
ensure streams are Send so they work with tokio::spawn. same fix as nmrs #359.
implement real-time d-bus signal subscriptions for modem state and signal quality.
modem state changes
subscribe to
Modem.StateChanged(old: i32, new: i32, reason: u32)signal.follow the pattern in
nmrs/src/monitoring/device.rs.signal quality
poll
SignalQualityproperty changes viaPropertiesChangedsignal, or useModem.Signalinterface if extended signal info is needed.modem added/removed
subscribe to
ObjectManager.InterfacesAdded/InterfacesRemovedon/org/freedesktop/ModemManager1for hotplug detection.stream trait bounds
ensure streams are
Sendso they work withtokio::spawn. same fix as nmrs #359.