ntrip-client 0.1.0

NTRIP client
Documentation

NTRIP Client

Rust Rust crates.io crates.io

MRSV License

NTRIP client used by all our applications that require RTCM messaging (downlink), through NTRIP connection.

Backend framework

ntrip-client currently uses tokio as the multi-threading backend.

Getting started

ntrip-client = "0.0.1"

Refer to the provided example for a complete demo.

// Configure server
let ntrip_config = "centipede".parse::<NtripConfig>();
let ntrip_creds = NtripCredentials{
    user: "centipede".to_string(),
    pass: "centipede".to_string(),
}

// Setup client
let mut client = NtripClient::new(ntrip_config, ntrip_creds).await.unwrap();

// List mounts
let server_info = client.list_mounts().await.unwrap();
for m in server_info.mounts {
    println!("{} - {}", m.name, m.details);
}

// Subscribe to a mount
let (exit_tx, exit_rx) = tokio::sync::broadcast(1);
let handle = client.mount("VALDM", exit_tx.clone());

loop {
    select!{
        m = client.next() => match m {
            Some(m) => {
                info!("Received RTCM message: {:?}", m);
            },
            None => {
                error!("NTRIP client stream ended");
                break;
            }
        },
        _ = exit_rx.recv() => {
            info!("Exiting on signal");
            break;
        }
    }
}

Licensing

This library is part of the NAV-solutions framework which is licensed under the Mozilla V2 Public license.