Skip to main content

AprsWeatherData

Struct AprsWeatherData 

Source
pub struct AprsWeatherData {
    pub wind_direction: Option<WindDirection>,
    pub wind_speed: Option<WindSpeed>,
    pub wind_gust: Option<WindSpeed>,
    pub temperature: Option<Temperature>,
    pub rain_last_hour: Option<Rainfall>,
    pub rain_last_24h: Option<Rainfall>,
    pub rain_since_midnight: Option<Rainfall>,
    pub humidity: Option<Humidity>,
    pub barometric_pressure: Option<Pressure>,
    pub luminosity: Option<Luminosity>,
    pub snow_last_24h: Option<Snowfall>,
    pub raw_rain_counter: Option<u16>,
}
Expand description

Weather data fields, parsed from either a position packet (symbol /_) or a positionless weather report (DTI _).

Every field is an Option — not all transmitting stations send all fields. Native APRS units are preserved; use the conversion methods on each type to obtain SI or other values.

Fields§

§wind_direction: Option<WindDirection>

Wind direction (degrees, 0=unknown). Native: degrees.

§wind_speed: Option<WindSpeed>

Sustained wind speed. Native: mph.

§wind_gust: Option<WindSpeed>

Peak wind gust in last 5 minutes. Native: mph.

§temperature: Option<Temperature>

Temperature. Native: °F.

§rain_last_hour: Option<Rainfall>

Rainfall in the last hour. Native: hundredths of an inch.

§rain_last_24h: Option<Rainfall>

Rainfall in the last 24 hours. Native: hundredths of an inch.

§rain_since_midnight: Option<Rainfall>

Rainfall since midnight. Native: hundredths of an inch.

§humidity: Option<Humidity>

Relative humidity 0–100 (wire 00 = 100%). Native: percent.

§barometric_pressure: Option<Pressure>

Barometric pressure. Native: tenths of a millibar.

§luminosity: Option<Luminosity>

Solar radiation. Native: W/m².

§snow_last_24h: Option<Snowfall>

Snowfall in the last 24 hours. Native: tenths of an inch.

§raw_rain_counter: Option<u16>

Raw rain counter (implementation-specific).

Implementations§

Source§

impl AprsWeatherData

Source

pub fn parse(b: &[u8]) -> Result<Self, AprsError>

Parse the weather field block.

Expected start: DDD/SSS (wind direction / wind speed), then lettered single-char fields: g t r p P h b l L s #.

Example: 220/004g005t077r000p000P000h50b09900

Source

pub fn encode(&self, out: &mut Vec<u8>)

Encode weather fields to bytes (without any header).

Trait Implementations§

Source§

impl Clone for AprsWeatherData

Source§

fn clone(&self) -> AprsWeatherData

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 AprsWeatherData

Source§

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

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

impl Default for AprsWeatherData

Source§

fn default() -> AprsWeatherData

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

impl PartialEq for AprsWeatherData

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for AprsWeatherData

Auto Trait Implementations§

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> 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.