pub async fn user_requests_wifi_list_refresh(state: HttpServerStateSync) -> StatusCode {
    let nm = match state.try_lock() {
        Ok(state) => state.network_manager.clone(),
        Err(_) => return StatusCode::INTERNAL_SERVER_ERROR,
    };
    if let Ok(_) = nm.scan_networks().await {
        StatusCode::OK
    } else {
        // Some network adapters do not allow a scan while a hotspot is running
        StatusCode::INTERNAL_SERVER_ERROR
    }
}
/// Called when the user requests a wifi list refresh via /refresh.
///
/// ## Crossmodule usage
/// This method calls into the network manager
Called when the user requests a wifi list refresh via /refresh.
Called when the user requests a wifi list refresh via / refresh .
pub async fn user_requests_wifi_list_refresh(state: HttpServerStateSync) -> StatusCode {
    let nm = match state.try_lock() {
        Ok(state) => state.network_manager.clone(),
        Err(_) => return StatusCode::INTERNAL_SERVER_ERROR,
    };
    if let Ok(_) = nm.scan_networks().await {
        StatusCode::OK
    } else {
        // Some network adapters do not allow a scan while a hotspot is running
        StatusCode::INTERNAL_SERVER_ERROR
    }
}
pub async fn user_requests_wifi_list_refresh ( state : HttpServerStateSync ) -> StatusCode { let nm = match state . try_lock ( ) { Ok ( state ) => state . network_manager . clone ( ) , Err ( _ ) => return StatusCode :: INTERNAL_SERVER_ERROR , } ; if let Ok ( _ ) = nm . scan_networks ( ) . await { StatusCode :: OK } else { // Some network adapters do not allow a scan while a hotspot is running StatusCode :: INTERNAL_SERVER_ERROR } }
Called when the user requests a wifi list refresh via /refresh.
Called when the user requests a wifi list refresh via / refresh .
state
HttpServerStateSync
state
HttpServerStateSync
crossmodule usage
This method calls into the network manager
This method calls into the network manager