pub(crate) async fn find_connection_by_mac(
        &self,
        hw: &String,
    ) -> Result<Option<(dbus::Path<'_>, WiFiConnectionSettings)>, CaptivePortalError> {
        let connections = {
            use super::generated::connections::Settings;
            let p = nonblock::Proxy::new(NM_BUSNAME, NM_SETTINGS_PATH, self.conn.clone());
            p.connections().await?
        };
        for connection_path in connections {
            let settings = wifi_settings::get_connection_settings(self.conn.clone(), connection_path.clone()).await?;
            if let Some(settings) = settings {
                // A matching connection could be found. Replace the settings with new ones and store to disk
                if settings.seen_bssids.contains(hw) {
                    return Ok(Some((connection_path, settings)));
                }
            }
        }
        return Ok(None);
    }
/// Returns the dbus network manager api connection path and old connection settings as tuple.
Returns the dbus network manager api connection path and old connection settings as tuple.
Returns the dbus network manager api connection path and old connection settings as tuple .
pub(crate) async fn find_connection_by_mac(
        &self,
        hw: &String,
    ) -> Result<Option<(dbus::Path<'_>, WiFiConnectionSettings)>, CaptivePortalError> {
        let connections = {
            use super::generated::connections::Settings;
            let p = nonblock::Proxy::new(NM_BUSNAME, NM_SETTINGS_PATH, self.conn.clone());
            p.connections().await?
        };
        for connection_path in connections {
            let settings = wifi_settings::get_connection_settings(self.conn.clone(), connection_path.clone()).await?;
            if let Some(settings) = settings {
                // A matching connection could be found. Replace the settings with new ones and store to disk
                if settings.seen_bssids.contains(hw) {
                    return Ok(Some((connection_path, settings)));
                }
            }
        }
        return Ok(None);
    }
pub ( crate ) async fn find_connection_by_mac ( & self , hw : & String , ) -> Result < Option < ( dbus :: Path < ' _ > , WiFiConnectionSettings ) > , CaptivePortalError > { let connections = { use super :: generated :: connections :: Settings ; let p = nonblock :: Proxy :: new ( NM_BUSNAME , NM_SETTINGS_PATH , self . conn . clone ( ) ) ; p . connections ( ) . await ? } ; for connection_path in connections { let settings = wifi_settings :: get_connection_settings ( self . conn . clone ( ) , connection_path . clone ( ) ) . await ? ; if let Some ( settings ) = settings { // A matching connection could be found. Replace the settings with new ones and store to disk if settings . seen_bssids . contains ( hw ) { return Ok ( Some ( ( connection_path , settings ) ) ) ; } } } return Ok ( None ) ; }
Returns the dbus network manager api connection path and old connection settings as tuple.
Returns the dbus network manager api connection path and old connection settings as tuple .
&self
hw
&String
&self
hw
&String