Skip to main content

TelemetryMetadata

Struct TelemetryMetadata 

Source
pub struct TelemetryMetadata {
    pub param_names: Vec<Option<Vec<u8>>>,
    pub unit_labels: Vec<Option<Vec<u8>>>,
    pub equations: Vec<TelemetryEquation>,
    pub bit_sense: u8,
    pub project_name: Vec<u8>,
}
Expand description

Telemetry metadata assembled from PARM./UNIT./EQNS./BITS. message texts.

Each field corresponds to one of the four message types that APRS uses to describe a station’s telemetry channels. They are sent as directed messages to the station whose telemetry they describe.

Fields§

§param_names: Vec<Option<Vec<u8>>>

Channel names: up to 5 analog + up to 8 digital = 13 entries.

§unit_labels: Vec<Option<Vec<u8>>>

Unit labels: same layout as param_names.

§equations: Vec<TelemetryEquation>

Equation coefficients for each of the 5 analog channels.

§bit_sense: u8

Bit sense flags: bit N (MSB first) is true if a 1 means “on”.

§project_name: Vec<u8>

Project name (from BITS. message, after the sense flags).

Implementations§

Source§

impl TelemetryMetadata

Source

pub fn parse_parm(text: &[u8]) -> Vec<Option<Vec<u8>>>

Parse the body of a PARM. message (text after the PARM. prefix).

Returns up to 13 comma-separated names (5 analog + 8 digital).

Source

pub fn parse_unit(text: &[u8]) -> Vec<Option<Vec<u8>>>

Parse the body of a UNIT. message.

Source

pub fn parse_eqns(text: &[u8]) -> Vec<TelemetryEquation>

Parse the body of an EQNS. message.

Format: a1,b1,c1,a2,b2,c2,... (5 triples, 15 values total).

Source

pub fn parse_bits(text: &[u8]) -> (u8, Vec<u8>)

Parse the body of a BITS. message.

Format: BBBBBBBB,Project Name where B is 0 or 1 (MSB = channel 1).

Trait Implementations§

Source§

impl Clone for TelemetryMetadata

Source§

fn clone(&self) -> TelemetryMetadata

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 TelemetryMetadata

Source§

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

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

impl Default for TelemetryMetadata

Source§

fn default() -> TelemetryMetadata

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

impl PartialEq for TelemetryMetadata

Source§

fn eq(&self, other: &TelemetryMetadata) -> 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 TelemetryMetadata

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.