#[non_exhaustive]pub struct Observation<'a> {
pub transport: Transport,
pub counter: Option<u8>,
pub payload: &'a [u8],
pub now_ms: u64,
pub unix_ms: Option<u64>,
pub rssi_dbm: Option<i8>,
pub beacon: Option<BeaconInfo>,
pub receiver_id: u16,
}Expand description
One received Remote ID frame with what the receiver knows about it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.transport: TransportLink it came on.
counter: Option<u8>Message counter from the frame, if the transport has one.
payload: &'a [u8]The message or message pack, header byte first, counter removed.
now_ms: u64Receiver monotonic clock, milliseconds.
unix_ms: Option<u64>Receiver UTC clock, Unix milliseconds, if it is trustworthy (NTP or GNSS). Enables the absolute timestamp checks.
rssi_dbm: Option<i8>Signal strength, dBm.
beacon: Option<BeaconInfo>Wi-Fi Beacon header fields (from crate::wifi::beacon_info).
receiver_id: u16Which receiver heard the frame (RIDF receiver_id; 0 for a single
receiver). Signal strength and Wi-Fi TSF continuity are tracked per
receiver, since a near and a far receiver hear the same frame at
very different levels.
Implementations§
Source§impl<'a> Observation<'a>
impl<'a> Observation<'a>
Sourcepub fn new(
transport: Transport,
counter: Option<u8>,
payload: &'a [u8],
now_ms: u64,
) -> Self
pub fn new( transport: Transport, counter: Option<u8>, payload: &'a [u8], now_ms: u64, ) -> Self
An observation with only the required fields.
Sourcepub fn with_unix_ms(self, unix_ms: u64) -> Self
pub fn with_unix_ms(self, unix_ms: u64) -> Self
Sets the receiver UTC clock.
Sourcepub fn with_beacon(self, beacon: BeaconInfo) -> Self
pub fn with_beacon(self, beacon: BeaconInfo) -> Self
Sets the Wi-Fi Beacon header fields.
Sourcepub fn with_receiver(self, receiver_id: u16) -> Self
pub fn with_receiver(self, receiver_id: u16) -> Self
Sets the receiver that heard the frame.