pub struct PeripheralFields {
pub callsign: Option<String>,
pub battery_percent: Option<u8>,
pub heart_rate: Option<u8>,
pub event_type: Option<u8>,
pub latitude: Option<f32>,
pub longitude: Option<f32>,
pub altitude: Option<f32>,
pub activity_level: Option<u8>,
pub alerts: Option<u8>,
}Expand description
Subset of merged-peripheral fields surfaced on
DataReceivedResult. Returned by
DataReceivedResult::peripheral_fields so callers don’t have to
destructure a positional tuple — adding a new field is a struct
update with the type system enforcing every consumer either reads
or ignores it explicitly, instead of silently re-indexing existing
destructures.
Fields§
§callsign: Option<String>Sender’s callsign (None when the peripheral has an empty callsign).
battery_percent: Option<u8>Sender’s battery percentage (None when the peripheral reports 0, which the wire convention treats as “absent”).
heart_rate: Option<u8>Sender’s heart rate (None when the wire byte is 0 — the
unwrap_or(0) convention from the Rust encode side).
event_type: Option<u8>Sender’s PeripheralEvent type (None when no event is attached).
latitude: Option<f32>Sender’s latitude (None when no location record is attached).
longitude: Option<f32>Sender’s longitude (None when no location record is attached).
altitude: Option<f32>Sender’s altitude in meters (None when no location record is attached, or when the location’s altitude field is itself absent).
activity_level: Option<u8>Sender’s activity level (0=Standing, 3=PossibleFall, 4=Prone …).
alerts: Option<u8>Sender’s health-alerts bitfield (e.g. ALERT_MAN_DOWN = 0x01).
Trait Implementations§
Source§impl Clone for PeripheralFields
impl Clone for PeripheralFields
Source§fn clone(&self) -> PeripheralFields
fn clone(&self) -> PeripheralFields
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more