#[non_exhaustive]pub enum Lifecycle {
FabricRemoved(FabricIndex),
FailSafeExpired {
fabric: Option<FabricIndex>,
},
CommissioningComplete(FabricIndex),
}Expand description
Something that happened to the node, which every cluster holding state scoped to it has to react to.
Read, write and invoke are driven by a peer; these three are driven by the node’s own life, and every one of them is a rule the specification states once and expects every cluster to obey:
- §11.18.6.12 —
RemoveFabric“SHALL remove all associated data” of the fabric. All of it: scenes, groups, bindings, ICD registrations, OTA providers, TLS endpoints, group keys, access control entries. A cluster that keeps one entry hands it to whoever is assigned that fabric index next. - §11.10.7.2.2 — an expired fail-safe rolls back what the abandoned commissioner staged.
- §11.10.7.6 —
CommissioningCompletemakes it permanent.
Delivered to every member of a handler tuple rather than routed by cluster id, because
unlike a path this is not addressed to one cluster: it is a fact about the node that all
of them are downstream of. Which is also why it is a method on ClusterHandler and not
a separate trait — a device’s cluster tuple is the one place that already names every
cluster it has, so the fan-out cannot be missed by forgetting to register something. The
CHIP SDK registers each cluster with FabricTable::AddFabricDelegate, and its own issue
tracker records what an unregistered cluster costs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FabricRemoved(FabricIndex)
A fabric was removed, or rolled back before it was ever complete (§11.18.6.12, §11.10.7.2.2 step 3).
Every cluster forgets everything scoped to that index. It is not “the accessing fabric”: an administrator may remove another’s, and a rollback removes one nobody was speaking on.
FailSafeExpired
The fail-safe expired without CommissioningComplete (§11.10.7.2.2).
A cluster that staged something reverts it. fabric is the fail-safe’s own fabric,
when it had one — a fail-safe armed over PASE before AddNOC has none.
Fields
fabric: Option<FabricIndex>The fabric the fail-safe was armed on, if it had reached one.
CommissioningComplete(FabricIndex)
CommissioningComplete succeeded on fabric (§11.10.7.6).
Whatever was staged under the fail-safe is now the device’s permanent state, so the snapshot it would have been rolled back to is dropped. A cluster that never drops it reverts to that snapshot at the next expiry, however many commissionings later — which is how a device loses the network credentials it has been using for a month.