Skip to main content

Stage

Enum Stage 

Source
#[non_exhaustive]
pub enum Stage {
Show 22 variants SecurePairing, ReadCommissioningInfo, ArmFailsafe, ConfigRegulatory, SendPaiCertRequest, SendDacCertRequest, SendAttestationRequest, AttestationVerification, SendOpCertSigningRequest, ValidateCsr, GenerateNocChain, SendTrustedRootCert, SendNoc, ReadNetworkCommissioningInfo, NetworkSetup, FailsafeBeforeNetworkEnable, NetworkEnable, EvictPreviousCaseSessions, FindOperationalForComplete, SendComplete, Cleanup, Failed,
}
Expand description

Cursor position inside the commissioning sequence.

Variants are ordered top-to-bottom in transition order. The transition function lives in next_stage (crate-internal).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SecurePairing

Entry state — caller has just constructed the super::Commissioner with a valid PASE session. No action emitted; advances on first poll() to Self::ReadCommissioningInfo.

§

ReadCommissioningInfo

Read BasicCommissioningInfo, RegulatoryConfig, etc. from the GeneralCommissioning cluster (id 0x0030) so the commissioner knows failsafe_expiry_length_seconds before arming the failsafe.

§

ArmFailsafe

GeneralCommissioning::ArmFailSafe (command id 0x00).

§

ConfigRegulatory

GeneralCommissioning::SetRegulatoryConfig (command id 0x02).

§

SendPaiCertRequest

OperationalCredentials::CertificateChainRequest with type=PAI (cluster 0x003E, command 0x02, type enum 0x01).

§

SendDacCertRequest

OperationalCredentials::CertificateChainRequest with type=DAC (type enum 0x02).

§

SendAttestationRequest

OperationalCredentials::AttestationRequest (command 0x00).

§

AttestationVerification

Off-wire: chain + signature + CD verification.

§

SendOpCertSigningRequest

OperationalCredentials::CSRRequest (command 0x04).

§

ValidateCsr

Off-wire: PKCS#10 self-signature + DAC attestation + nonce echo.

§

GenerateNocChain

Off-wire: build + sign the NOC under the commissioner’s RCAC.

§

SendTrustedRootCert

OperationalCredentials::AddTrustedRootCertificate (command 0x0B).

§

SendNoc

OperationalCredentials::AddNOC (command 0x06).

§

ReadNetworkCommissioningInfo

Read NetworkCommissioning::FeatureMap (attribute 0xFFFC) and ConnectMaxTimeSeconds (attribute 0x0003) on endpoint 0. FeatureMap determines whether the device supports Wi-Fi, Ethernet, or Thread (or some combination). Branching at this stage’s response routes by the supplied super::NetworkCredentials variant, cross-checked against the device FeatureMap: matching credentials advance to NetworkSetup, AlreadyOnNetwork skips to EvictPreviousCaseSessions, and a credential type absent from the FeatureMap fails with NetworkFeatureUnsupported.

§

NetworkSetup

Network provisioning: NetworkCommissioning::AddOrUpdateWiFiNetwork (cluster 0x0031 command 0x02) for Wi-Fi credentials, or AddOrUpdateThreadNetwork (command 0x03) for a Thread dataset. The stage is generic; the command is selected by the supplied super::NetworkCredentials variant. Skipped for AlreadyOnNetwork / Ethernet-only devices.

§

FailsafeBeforeNetworkEnable

Second GeneralCommissioning::ArmFailSafe (cluster 0x0030 command 0x00). Extends the failsafe window before ConnectNetwork so the device has room to associate with the operational network and re-discover the commissioner via mDNS. The extension is sized from the device’s ConnectMaxTimeSeconds (Thread attach is slower than Wi-Fi association), falling back to a generous default. Re-uses the existing Expectation::ArmFailsafeResponse.

§

NetworkEnable

NetworkCommissioning::ConnectNetwork (cluster 0x0031 command 0x06). The device associates with the operational network and (typically) returns ConnectNetworkResponse over PASE before switching networks. The network_id is the SSID for Wi-Fi and the Extended PAN ID for Thread.

§

EvictPreviousCaseSessions

Evict any prior CASE session for this fabric/peer pair. M6.4 only supports new-fabric commissioning — no eviction needed — so the stage advances immediately. Slot reserved for M8 multi-fabric work.

§

FindOperationalForComplete

Caller establishes a CASE session via mDNS find-operational + SIGMA handshake (M6.6 mechanics). State machine emits Action::EstablishCase and waits for on_case_established().

§

SendComplete

GeneralCommissioning::CommissioningComplete (command 0x04), sent over the freshly-established CASE session.

§

Cleanup

Terminal success. Emits Action::Done(CommissionedFabric).

§

Failed

Terminal failure. Emits Action::Abort.

Trait Implementations§

Source§

impl Clone for Stage

Source§

fn clone(&self) -> Stage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Stage

Source§

impl Debug for Stage

Source§

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

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

impl Eq for Stage

Source§

impl Hash for Stage

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Stage

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Stage

Auto Trait Implementations§

§

impl Freeze for Stage

§

impl RefUnwindSafe for Stage

§

impl Send for Stage

§

impl Sync for Stage

§

impl Unpin for Stage

§

impl UnsafeUnpin for Stage

§

impl UnwindSafe for Stage

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.