#[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
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.