From 0799b02d346a8e90619008270731505d36912e08 Mon Sep 17 00:00:00 2001 From: theroguevigilante Date: Mon, 13 Jul 2026 21:23:24 +0530 Subject: [PATCH] Remove current_bluetooth_info --- nmrs/src/monitoring/bluetooth.rs | 45 -------------------------------- 1 file changed, 45 deletions(-) diff --git a/nmrs/src/monitoring/bluetooth.rs b/nmrs/src/monitoring/bluetooth.rs index 61b0f21a..7815200d 100644 --- a/nmrs/src/monitoring/bluetooth.rs +++ b/nmrs/src/monitoring/bluetooth.rs @@ -83,51 +83,6 @@ pub(crate) async fn current_bluetooth_bdaddr(conn: &Connection) -> Option Option<(String, u32)> { - let nm = try_log!(NMProxy::new(conn).await, "Failed to create NM proxy"); - let devices = try_log!(nm.get_devices().await, "Failed to get devices"); - - for dp in devices { - let dev_builder = try_log!( - NMDeviceProxy::builder(conn).path(dp.clone()), - "Failed to create device proxy builder" - ); - let dev = try_log!(dev_builder.build().await, "Failed to build device proxy"); - - let dev_type = try_log!(dev.device_type().await, "Failed to get device type"); - if dev_type != device_type::BLUETOOTH { - continue; - } - - // Check if device is in an active/connected state - let state = try_log!(dev.state().await, "Failed to get device state"); - // State 100 = Activated (connected) - if state != device_state::ACTIVATED { - continue; - } - - // Get the Bluetooth MAC address and capabilities - let bt_builder = try_log!( - NMBluetoothProxy::builder(conn).path(dp.clone()), - "Failed to create Bluetooth proxy builder" - ); - let bt = try_log!(bt_builder.build().await, "Failed to build Bluetooth proxy"); - - if let (Ok(bdaddr), Ok(capabilities)) = (bt.hw_address().await, bt.bt_capabilities().await) - { - return Some((bdaddr, capabilities)); - } - } - None -} - #[cfg(test)] mod tests { use super::*;