Skip to main content

Action

Enum Action 

Source
#[non_exhaustive]
pub enum Action { Invoke { session: SessionContext, endpoint: u16, cluster: u32, command: u32, payload: Vec<u8>, expect: Expectation, }, ReadAttribute { session: SessionContext, endpoint: u16, cluster: u32, attributes: &'static [u32], expect: Expectation, }, EvictCase { fabric_id: u64, peer_node_id: u64, }, EstablishCase { fabric_id: u64, peer_node_id: u64, }, Done(CommissionedFabric), Abort { send_disarm_failsafe: bool, reason: String, }, }
Expand description

The next piece of work the caller must perform.

Returned by super::Commissioner::poll. The state machine is idempotent: calling poll twice without an intervening on_response returns the same Action.

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

Invoke

Invoke a cluster command. The caller frames payload into an Invoke envelope and routes via matter-transport over the indicated session. The decoded response payload is fed back via super::Commissioner::on_response with the matching expect.

Fields

§session: SessionContext

Which session to route the Invoke over.

§endpoint: u16

Matter endpoint (always 0 for commissioning).

§cluster: u32

Cluster ID (0x0030 GeneralCommissioning or 0x003E OperationalCredentials for all M6.4 stages).

§command: u32

Cluster command ID.

§payload: Vec<u8>

TLV-encoded command payload.

§expect: Expectation

The response type the state machine expects next.

§

ReadAttribute

Read attributes from a cluster. Used only by Stage::ReadCommissioningInfo.

Fields

§session: SessionContext

Which session to route the Read over.

§endpoint: u16

Matter endpoint (always 0 for commissioning).

§cluster: u32

Cluster ID.

§attributes: &'static [u32]

Attribute IDs to read.

§expect: Expectation

The response type the state machine expects next.

§

EvictCase

Evict any prior CASE session for this fabric/peer pair.

Reserved for M8 multi-fabric work; never emitted by M6.4’s state machine. Kept in the enum so M8 can wire eviction in without a SemVer bump.

Fields

§fabric_id: u64

Fabric ID to evict on.

§peer_node_id: u64

Peer operational node ID to evict for.

§

EstablishCase

Discover the device on its operational network and establish a CASE session. Caller calls Commissioner::on_case_established (added in M6.4.5) on success or on_response(Expectation::CaseFailed, &[]) on failure.

Fields

§fabric_id: u64

Fabric ID to establish CASE on.

§peer_node_id: u64

Peer operational node ID to establish with.

§

Done(CommissionedFabric)

Commissioning succeeded. Caller may persist the CommissionedFabric long-term.

§

Abort

Commissioning failed. If send_disarm_failsafe is true, the caller should send ArmFailSafe(expiry_length_seconds=0) to the device over PASE to roll the device back to its pre-commissioning state.

reason is a rendered, log-friendly summary of the CommissioningError that caused the abort. The caller will have also received that error directly via super::Commissioner::on_response’s Err return — reason here is supplementary, intended for logs.

Fields

§send_disarm_failsafe: bool

Whether the caller should send DisarmFailsafe before dropping the PASE session.

§reason: String

Pre-rendered description of the failure cause.

Trait Implementations§

Source§

impl Clone for Action

Source§

fn clone(&self) -> Action

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 Debug for Action

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.