/// Run device discovery and update a given service table.
Run device discovery and update a given service table.
Run device discovery and update a given service table .
fn network_scanner_thread<L: Logger + Clone>(
    mut logger: L,
    rtsp_paths_file: &str,
    mjpeg_paths_file: &str,
    app_context: Shared<AppContext>) {
    log_info!(logger, "looking for local services...");
    let report = utils::result_or_log(&mut logger, Severity::WARN,
        "network scanner error",
        discovery::scan_network(
            rtsp_paths_file,
            mjpeg_paths_file));
    if let Some(report) = report {
        let mut app_context = app_context.lock()
            .unwrap();
        {
            let config   = &mut app_context.config;
            let services = report.services();
            let count    = services.len();
            for svc in services {
                config.add(svc.clone());
            }
            config.update_active_services();
            log_info!(logger, "{} services found, current service table: {}",
                count, config.service_table());
        }
        app_context.scan_report = report;
    }
}
fn network_scanner_thread < L : Logger + Clone > ( mut logger : L , rtsp_paths_file : & str , mjpeg_paths_file : & str , app_context : Shared < AppContext > ) { log_info ! ( logger " " ) ; let report = utils :: result_or_log ( & mut logger , Severity :: WARN , " " , discovery :: scan_network ( rtsp_paths_file , mjpeg_paths_file ) ) ; if let Some ( report ) = report { let mut app_context = app_context . lock ( ) . unwrap ( ) ; { let config = & mut app_context . config ; let services = report . services ( ) ; let count = services . len ( ) ; for svc in services { config . add ( svc . clone ( ) ) ; } config . update_active_services ( ) ; log_info ! ( logger " " count config service_table ( ) ) ; } app_context . scan_report = report ; } }
Run device discovery and update a given service table.
Run device discovery and update a given service table .
logger
L
rtsp_paths_file
&str
mjpeg_paths_file
&str
app_context
Shared<AppContext>