/// Issues a scan request to the client policy layer.
Issues a scan request to the client policy layer.
Issues a scan request to the client policy layer .
pub async fn handle_scan(
    client_controller: wlan_policy::ClientControllerProxy,
) -> Result<Vec<wlan_policy::ScanResult>, Error> {
    let (client_proxy, server_end) =
        create_proxy::<wlan_policy::ScanResultIteratorMarker>().unwrap();
    let fut = async { client_controller.scan_for_networks(server_end) };
    run_proxy_command(Box::pin(fut)).await?;
    let mut scanned_networks = Vec::<wlan_policy::ScanResult>::new();
    loop {
        match run_proxy_command(Box::pin(client_proxy.get_next())).await? {
            Ok(mut new_networks) => {
                if new_networks.is_empty() {
                    break;
                }
                scanned_networks.append(&mut new_networks);
            }
            Err(e) => return Err(format_err!("Scan failure error: {:?}", e)),
        }
    }
    Ok(scanned_networks)
}
pub async fn handle_scan ( client_controller : wlan_policy :: ClientControllerProxy , ) -> Result < Vec < wlan_policy :: ScanResult > , Error > { let ( client_proxy , server_end ) = create_proxy :: < wlan_policy :: ScanResultIteratorMarker > ( ) . unwrap ( ) ; let fut = async { client_controller . scan_for_networks ( server_end ) } ; run_proxy_command ( Box :: pin ( fut ) ) . await ? ; let mut scanned_networks = Vec :: < wlan_policy :: ScanResult > :: new ( ) ; loop { match run_proxy_command ( Box :: pin ( client_proxy . get_next ( ) ) ) . await ? { Ok ( mut new_networks ) => { if new_networks . is_empty ( ) { break ; } scanned_networks . append ( & mut new_networks ) ; } Err ( e ) => return Err ( format_err ! ( " " e ) ) , } } Ok ( scanned_networks ) }
Issues a scan request to the client policy layer.
Issues a scan request to the client policy layer .
client_controller
wlan_policy::ClientControllerProxy