Skip to main content

CommissionerControl

Struct CommissionerControl 

Source
pub struct CommissionerControl<'a, H: CommissionerControlHooks, const N: usize = 4> { /* private fields */ }
Expand description

Commissioner Control over a node that can commission others.

Implementations§

Source§

impl<'a, H: CommissionerControlHooks, const N: usize> CommissionerControl<'a, H, N>

Source

pub fn new(hooks: &'a H, categories: SupportedDeviceCategoryBitmap) -> Self

A cluster over hooks, advertising categories.

Source

pub fn conforming( feature_map: u32, optional: &Optional<'_>, ) -> Result<Conforming<1, 2, 1, 1>>

The descriptor for an instance, derived from the specification’s tables.

Source

pub const fn categories(&self) -> SupportedDeviceCategoryBitmap

SupportedDeviceCategories (§11.26.5.1).

Source

pub fn pending(&self) -> Ref<'_, Vec<Request, N>>

The requests this server has not yet answered.

Source

pub fn decide( &self, request_id: u64, client: NodeId, decision: Decision, ) -> bool

Records the server’s decision about a request, producing §11.26.7.1’s event.

Separate from the command because the decision may take a person: §11.26.6.1 is explicit that the two-step flow exists “to provide the server time for interacting with a user”.

Source

pub fn take_events(&self) -> Vec<CommissioningRequestResult, N>

Takes the event records the cluster has produced.

Source

pub fn reverse_pending(&self) -> bool

Whether the last CommissionNode asked the caller to send a ReverseOpenCommissioningWindow back to the client.

§11.26.6’s command table marks that one server ⇒ client: it is not a response, it is a command the server invokes on the client over the same CASE session. So the interaction model’s response machinery cannot carry it, and the caller sends it — which is also why it is the one command here this cluster does not answer with itself.

Source

pub fn forget(&self, request_id: u64, client: NodeId)

Forgets a request — after the reverse window has been sent, or the approval has lapsed.

Trait Implementations§

Source§

impl<H: CommissionerControlHooks, const N: usize> Cluster for CommissionerControl<'_, H, N>

So a tuple of clusters can dispatch to it by id.

Source§

const ID: ClusterId = ID

The cluster id this implementation serves.
Source§

impl<H: CommissionerControlHooks, const N: usize> ClusterHandler for CommissionerControl<'_, H, N>

Source§

fn read( &self, resolved: &Resolved<'_>, _ctx: &InteractionContext<'_>, w: &mut TlvWriter<'_>, tag: Tag, ) -> Result<(), Status>

Writes the value of resolved’s attribute under tag. Read more
Source§

fn invoke( &self, resolved: &ResolvedCommand<'_>, fields: Option<&[u8]>, ctx: &InteractionContext<'_>, w: &mut TlvWriter<'_>, tag: Tag, ) -> Result<Option<CommandId>, StatusIb>

Runs a command. Read more
Source§

fn data_version(&self, _resolved: &Resolved<'_>) -> Option<u32>

The cluster instance’s data version (§7.10.3), if it tracks one. Read more
Source§

fn write( &self, _resolved: &Resolved<'_>, _data: &[u8], _op: WriteOp, _ctx: &InteractionContext<'_>, ) -> Result<(), Status>

Writes data — the encoded TLV element, tag included — into the attribute. Read more
Source§

fn on_lifecycle(&self, _event: Lifecycle)

Reacts to something that happened to the node (see Lifecycle). Read more
Source§

impl<'a, H: Debug + CommissionerControlHooks, const N: usize> Debug for CommissionerControl<'a, H, N>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, H, const N: usize = 4> !Freeze for CommissionerControl<'a, H, N>

§

impl<'a, H, const N: usize = 4> !RefUnwindSafe for CommissionerControl<'a, H, N>

§

impl<'a, H, const N: usize = 4> !Sync for CommissionerControl<'a, H, N>

§

impl<'a, H, const N: usize> Forget for CommissionerControl<'a, H, N>

§

impl<'a, H, const N: usize> Move for CommissionerControl<'a, H, N>

§

impl<'a, H, const N: usize> Send for CommissionerControl<'a, H, N>

§

impl<'a, H, const N: usize> Unpin for CommissionerControl<'a, H, N>

§

impl<'a, H, const N: usize> UnsafeUnpin for CommissionerControl<'a, H, N>

§

impl<'a, H, const N: usize> UnwindSafe for CommissionerControl<'a, H, N>

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<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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.