Skip to main content

System

Struct System 

Source
pub struct System {
Show 13 fields pub protocol_version: u8, pub operator_location_type: OperatorLocationType, pub classification_type: ClassificationType, pub operator_latitude: f64, pub operator_longitude: f64, pub area_count: u16, pub area_radius: u16, pub area_ceiling: Option<f32>, pub area_floor: Option<f32>, pub category_eu: CategoryEu, pub class_eu: ClassEu, pub operator_altitude_geo: Option<f32>, pub timestamp: u32,
}
Expand description

System message: operator position and the operating area.

Fields§

§protocol_version: u8

Protocol version from the header.

§operator_location_type: OperatorLocationType

Source of the operator position.

§classification_type: ClassificationType

Classification scheme.

§operator_latitude: f64

Operator latitude in degrees (0, 0 means unknown).

§operator_longitude: f64

Operator longitude in degrees.

§area_count: u16

Number of aircraft in the group (1 for a single aircraft).

§area_radius: u16

Radius of the group’s area in meters, 10 m steps up to 2550.

§area_ceiling: Option<f32>

Area ceiling in meters (WGS84).

§area_floor: Option<f32>

Area floor in meters (WGS84).

§category_eu: CategoryEu

EU category, when classification_type is EU.

§class_eu: ClassEu

EU class, when classification_type is EU.

§operator_altitude_geo: Option<f32>

Operator altitude in meters above the WGS84 ellipsoid.

§timestamp: u32

Seconds since 2019-01-01 00:00:00 UTC (0 when the transmitter predates F3411-22a).

Implementations§

Source§

impl System

Source

pub fn decode(raw: &[u8; 25]) -> Result<Self, Error>

Decodes a System message.

Source

pub fn encode(&self) -> Result<[u8; 25], Error>

Encodes the message.

Source

pub fn operator_position(&self) -> Option<(f64, f64)>

Operator latitude and longitude, or None for 0, 0 (unknown).

This is the raw position regardless of what it means. To tell where the drone launched from apart from where the pilot is now, use takeoff_position, live_operator_position and fixed_operator_position, which each return a position only when the transmitter tagged it that way.

Source

pub fn takeoff_position(&self) -> Option<(f64, f64)>

The takeoff / home point: where the aircraft launched from.

Returns a position only when the System message tags its operator position as the takeoff location (OperatorLocationType::Takeoff), which is the common case for a ground control station that stays at the launch point. None for a live or fixed operator position, or when the position is unset (0, 0).

This answers a question the pilot position cannot: an operator who needs to find the launch site, not the aircraft, reads it here.

Source

pub fn live_operator_position(&self) -> Option<(f64, f64)>

The operator’s live GNSS position: where the pilot is right now.

Returns a position only when the System message tags its operator position as a live fix (OperatorLocationType::LiveGnss), the case for a controller that reports its own moving GNSS position. None otherwise.

Source

pub fn fixed_operator_position(&self) -> Option<(f64, f64)>

The operator’s fixed, declared ground position.

Returns a position only when the System message tags its operator position as fixed (OperatorLocationType::Fixed). None otherwise.

Source

pub fn unix_timestamp(&self) -> Option<u64>

The timestamp as Unix seconds, or None when it is 0 (not sent).

Trait Implementations§

Source§

impl Clone for System

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for System

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for System

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for System

Available on crate feature serde only.
Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for System

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for System

Available on crate feature serde only.
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for System

Auto Trait Implementations§

§

impl Forget for System

§

impl Freeze for System

§

impl Move for System

§

impl RefUnwindSafe for System

§

impl Send for System

§

impl Sync for System

§

impl Unpin for System

§

impl UnsafeUnpin for System

§

impl UnwindSafe for System

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.