Skip to content

Commit 03cbef8

Browse files
committed
add source
1 parent 319d67f commit 03cbef8

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

swiftnav/src/nmea/source.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#[derive(Debug, Copy, Clone, PartialEq, Default)]
2+
pub enum Source {
3+
/// USA Global Positioning System
4+
#[default]
5+
GPS,
6+
/// Russian Federation GLONASS
7+
GLONASS,
8+
// Navigation Indian Constellation
9+
NavIC,
10+
/// European Union Gallileo
11+
Gallileo,
12+
/// China's Beidou
13+
BDS,
14+
/// Global Navigation Sattelite System. Some combination of other systems. Depends on receiver
15+
/// model, receiver settings, etc..
16+
GNSS,
17+
/// Quasi-Zenith Satellite System (Japan)
18+
QZSS,
19+
}
20+
21+
impl Source {
22+
#[must_use]
23+
pub fn to_nmea_talker_id(&self) -> &str {
24+
match self {
25+
Source::GPS => "GP",
26+
Source::GLONASS => "GL",
27+
Source::NavIC => "GI",
28+
Source::Gallileo => "GA",
29+
Source::BDS => "GB",
30+
Source::GNSS => "GN",
31+
Source::QZSS => "GQ",
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)