Skip to main content

UplinkEvent

Struct UplinkEvent 

Source
pub struct UplinkEvent {
Show 14 fields pub deduplication_id: String, pub time: Option<String>, pub application_id: String, pub device_name: String, pub dev_eui: Eui, pub dev_addr: Option<u32>, pub adr: bool, pub data_rate: u8, pub fcnt: u32, pub fport: Option<u8>, pub confirmed: bool, pub data: Vec<u8>, pub frequency_hz: Option<u32>, pub receptions: Vec<Reception>,
}
Expand description

An uplink as a ChirpStack server published it.

Fields§

§deduplication_id: String

The identifier ChirpStack gave the uplink once it had deduplicated it across gateways.

§time: Option<String>

When the server received it, as RFC 3339 text, if the event carried the time.

§application_id: String

The application the device belongs to.

§device_name: String

The device’s name on the server.

§dev_eui: Eui

The device’s identifier.

§dev_addr: Option<u32>

The device’s address in its current session.

§adr: bool

Whether the uplink had adaptive data rate on.

§data_rate: u8

The data rate it arrived at, as the region numbers them.

§fcnt: u32

The uplink frame counter.

§fport: Option<u8>

The application port, or None for an uplink the server reports without one.

§confirmed: bool

Whether the device asked for an acknowledgment.

§data: Vec<u8>

The decrypted application payload.

§frequency_hz: Option<u32>

The frequency it arrived on, in hertz.

§receptions: Vec<Reception>

Every gateway that heard it.

Implementations§

Source§

impl UplinkEvent

Source

pub fn from_json(text: &str) -> Result<UplinkEvent, EventError>

Reads an uplink event.

§Arguments
  • text - the MQTT message’s payload.
§Returns

The event.

§Errors

Returns EventError::Json for text that is not a JSON object, EventError::Missing without deviceInfo.devEui, and EventError::Invalid for a field of the wrong kind: an identifier that is not hexadecimal, a payload that is not base64, or a number out of its range.

Source

pub fn best_reception(&self) -> Option<&Reception>

Returns the gateway that heard the uplink best.

§Returns

The reception with the highest signal-to-noise ratio, or None for an event that named no gateway.

Trait Implementations§

Source§

impl Clone for UplinkEvent

Source§

fn clone(&self) -> UplinkEvent

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 UplinkEvent

Source§

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

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

impl PartialEq for UplinkEvent

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for UplinkEvent

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