NTRIP Client
============
[](https://github.com/nav-solutions/ntrip-client/actions/workflows/rust.yml)
[](https://github.com/nav-solutions/ntrip-client/actions/workflows/daily.yml)
[](https://docs.rs/ntrip-client/)
[](https://crates.io/crates/ntrip-client)
[](https://github.com/rust-lang/rust/releases/tag/1.78.0)
[](https://github.com/nav-solutions/ntrip-client/blob/main/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
===============
```toml
ntrip-client = "0.0.1"
```
Refer to the [provided example](examples/) for a complete demo.
```rust
// 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](https://github.com/nav-solutions)
which is licensed under the [Mozilla V2 Public](https://www.mozilla.org/en-US/MPL/2.0) license.