pub enum Effect {
Show 17 variants
ApplyRadio(RadioSettings),
StartTransmit,
SignIdentity {
tid: u8,
},
SampleRssi {
tid: u8,
},
SampleBattery {
tid: u8,
},
SampleIlluminance {
tid: u8,
},
SetPairingPin {
tid: u8,
pin: Option<u32>,
},
ReadTime {
tid: u8,
},
ApplyTime {
epoch: Option<u32>,
},
SampleGnss {
tid: u8,
key: u32,
},
DeviceNameChanged,
DrainQueue,
SaveSnapshot {
tid: u8,
},
ClearSaved {
tid: u8,
},
ProvisionIdentity {
tid: u8,
},
ApplyAlert(AlertState),
FactoryReset,
}Expand description
A radio side effect for the caller to execute.
Variants§
ApplyRadio(RadioSettings)
The radio configuration changed; (re)apply it.
StartTransmit
Begin transmitting Session::tx_data at
Session::tx_power; report completion with
Session::on_tx_result.
SignIdentity
Build and sign the device identity’s node-identity blob and feed
it back with Session::respond_identity_blob, quoting this
tid. The platform owns the signing key and the advertised
profile; the session owns only the properties that shape it.
SampleRssi
Sample the current instantaneous RSSI from the radio and feed the
result back with Session::respond_rssi, quoting this tid. Emitted
for a PROP_PHY_RSSI get while the PHY is enabled, because the session
itself has no live view of the radio.
SampleBattery
Obtain a battery status snapshot from the platform’s battery
source and feed it back with Session::respond_battery, quoting
this tid. Emitted for a PROP_BATTERY get when at least one
measurement is reported; the session never caches readings, so
every get samples.
SampleIlluminance
Take an ambient light measurement and feed it back with
Session::respond_illuminance, quoting this tid. Emitted for a
PROP_ILLUMINANCE get; like the battery, nothing is cached, so
every get samples.
SetPairingPin
Apply and persist a new BLE pairing PIN, then complete the deferred
property transaction with Session::respond_pin_set.
ReadTime
Read the platform’s wall clock and feed it back with
Session::respond_time, quoting this tid. Emitted for a
PROP_TIME get: the clock belongs to the platform, which is the
only layer that knows whether it has been set and how far it has
advanced since.
ApplyTime
A PROP_TIME write. Some sets the platform wall clock to that
Unix second; None returns it to not knowing what time it is,
which is what stops a device with a screen from displaying a clock.
A manual set outranks every receiver-derived one — the operator is
the more authoritative source by definition — so the platform
applies this unconditionally, including while
PROP_GNSS_TIME_TRUST is clear.
SampleGnss
Sample the receiver’s current view of position and constellation
and feed it back with Session::respond_gnss, quoting this tid
and key. Emitted for a get of any positioning property; the
session never caches a reading, so every get samples.
DeviceNameChanged
The live human-readable device name changed. Transports that expose a name should refresh it without disrupting the active session.
DrainQueue
A CMD_QUEUE_DRAIN accepted a non-empty queue. Repeatedly call
Session::drain_step until it returns false, flushing the
emitted frame to the transport between calls (each step emits at
most one frame, so a bounded emitter never overflows and the
transport can apply backpressure).
SaveSnapshot
CMD_SAVE: durably store the bytes produced by
Session::encode_snapshot, replacing any previous snapshot,
then complete with Session::respond_save. Success must not
be reported before the write has committed.
ClearSaved
CMD_CLEAR: erase the stored snapshot and all other persisted
provisioning — including the independently persisted device
identity — then complete with Session::respond_clear. Live
state, BLE bonds, and the pairing PIN are unaffected.
ProvisionIdentity
A PROP_DEV_PRIVATE_KEY write is provisioning the device
identity. Read the staged request with
Session::identity_request, build the keypair (drawing the
secret from a cryptographically secure RNG when the request is
IdentitySource::Generate), persist it durably, and complete
with Session::respond_identity. Success must not be
reported before the identity is durably stored (spec
§PROP_DEV_PRIVATE_KEY).
ApplyAlert(AlertState)
The locate alert changed; start or stop the board’s physical indication. Carries the authoritative new state, so a board can treat it as idempotent — it is emitted for a host write, a local cancellation, and the deadline alike.
FactoryReset
CMD_FACTORY_RESET: erase ALL mutable state — every persisted
journal (saved snapshot, device identity, frame-counter
boundaries, BLE bonds, pairing PIN) — and reboot. The platform
performs the wipe and reset; nothing is emitted and no respond_*
completion follows, because the reboot drops the link. In-RAM
session state is discarded by the reset itself.
Trait Implementations§
impl Copy for Effect
impl Eq for Effect
impl StructuralPartialEq for Effect
Auto Trait Implementations§
impl Freeze for Effect
impl RefUnwindSafe for Effect
impl Send for Effect
impl Sync for Effect
impl Unpin for Effect
impl UnwindSafe for Effect
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)