Effect

Enum Effect 

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

Fields

§tid: u8
§

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.

Fields

§tid: u8
§

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.

Fields

§tid: u8
§

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.

Fields

§tid: u8
§

SetPairingPin

Apply and persist a new BLE pairing PIN, then complete the deferred property transaction with Session::respond_pin_set.

Fields

§tid: u8
§

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.

Fields

§tid: u8
§

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.

Fields

§epoch: Option<u32>
§

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.

Fields

§tid: u8
§key: u32
§

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.

Fields

§tid: u8
§

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.

Fields

§tid: u8
§

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

Fields

§tid: u8
§

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§

Source§

impl Clone for Effect

Source§

fn clone(&self) -> Effect

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Effect

Source§

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

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

impl PartialEq for Effect

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Effect

Source§

impl Eq for Effect

Source§

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> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

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
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.