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: StringThe 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: StringThe application the device belongs to.
device_name: StringThe device’s name on the server.
dev_eui: EuiThe device’s identifier.
dev_addr: Option<u32>The device’s address in its current session.
adr: boolWhether the uplink had adaptive data rate on.
data_rate: u8The data rate it arrived at, as the region numbers them.
fcnt: u32The uplink frame counter.
fport: Option<u8>The application port, or None for an uplink the server reports without one.
confirmed: boolWhether 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
impl UplinkEvent
Sourcepub fn from_json(text: &str) -> Result<UplinkEvent, EventError>
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.
Sourcepub fn best_reception(&self) -> Option<&Reception>
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
impl Clone for UplinkEvent
Source§fn clone(&self) -> UplinkEvent
fn clone(&self) -> UplinkEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more