pub struct Location {Show 17 fields
pub protocol_version: u8,
pub status: Status,
pub height_type: HeightType,
pub direction: Option<f32>,
pub speed_horizontal: Option<f32>,
pub speed_vertical: Option<f32>,
pub latitude: f64,
pub longitude: f64,
pub altitude_baro: Option<f32>,
pub altitude_geo: Option<f32>,
pub height: Option<f32>,
pub horizontal_accuracy: HorizontalAccuracy,
pub vertical_accuracy: VerticalAccuracy,
pub baro_accuracy: VerticalAccuracy,
pub speed_accuracy: SpeedAccuracy,
pub timestamp_accuracy: TimestampAccuracy,
pub timestamp: Option<f32>,
}Expand description
Location and vector message.
Fields the transmitter marks as unknown decode to None.
Fields§
§protocol_version: u8Protocol version from the header.
status: StatusOperational status.
height_type: HeightTypeReference of height.
direction: Option<f32>Track over ground in degrees clockwise from true north, 0 to 359.
speed_horizontal: Option<f32>Ground speed in m/s (0.25 m/s steps up to 63.75, then 0.75 m/s steps up to 254.25).
speed_vertical: Option<f32>Vertical speed in m/s, positive up, 0.5 m/s steps, -62 to 62.
latitude: f64Latitude in degrees. 0 together with longitude 0 means unknown, see Location::position.
longitude: f64Longitude in degrees.
altitude_baro: Option<f32>Pressure altitude in meters (standard atmosphere).
altitude_geo: Option<f32>Geodetic altitude in meters above the WGS84 ellipsoid.
height: Option<f32>Height in meters above the reference in height_type.
horizontal_accuracy: HorizontalAccuracyHorizontal accuracy code.
vertical_accuracy: VerticalAccuracyGeodetic altitude accuracy code.
baro_accuracy: VerticalAccuracyPressure altitude accuracy code.
speed_accuracy: SpeedAccuracySpeed accuracy code.
timestamp_accuracy: TimestampAccuracyTimestamp accuracy code.
timestamp: Option<f32>Time of the position in seconds after the full UTC hour, 0.1 s steps.
Implementations§
Source§impl Location
impl Location
Sourcepub fn encode(&self) -> Result<[u8; 25], Error>
pub fn encode(&self) -> Result<[u8; 25], Error>
Encodes the message, rejecting values outside the field ranges.
Sourcepub fn position(&self) -> Option<(f64, f64)>
pub fn position(&self) -> Option<(f64, f64)>
Latitude and longitude, or None when the transmitter sent 0, 0 (unknown).
Sourcepub fn check(&self) -> impl Iterator<Item = LocationIssue>
pub fn check(&self) -> impl Iterator<Item = LocationIssue>
Checks the decoded values against the ranges the standard allows and reports every problem found. The decoder itself accepts any bit pattern (as the reference library does), so receivers that want to drop corrupted or spoofed frames should call this.
Sourcepub fn is_plausible(&self) -> bool
pub fn is_plausible(&self) -> bool
true if Location::check finds nothing.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Location
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Location
serde only.