pub struct BaseDeviceBehavior { /* private fields */ }Expand description
Base Device Behavior (BDB) commissioning manager.
Orchestrates the standard commissioning procedures defined in the BDB
specification: initialization, network steering, network formation,
finding & binding, and touchlink. The application owns the
[ZigbeeDevice] and the Nlme; commissioning methods borrow the device
for the duration of the procedure.
Like the layers below, procedures take &self and keep their few
attributes (BDB 5.3) behind interior mutability, so one instance can be
shared. They are not meant to overlap, though: run one commissioning
procedure at a time.
Implementations§
Source§impl BaseDeviceBehavior
impl BaseDeviceBehavior
pub fn new(config: Config) -> Self
Sourcepub fn commissioning_status(&self) -> BdbCommissioningStatus
pub fn commissioning_status(&self) -> BdbCommissioningStatus
bdbCommissioningStatus (BDB 5.3.1): how the last commissioning
procedure ended, or InProgress while one runs.
Sourcepub fn commissioning_mode(&self) -> CommissioningMode
pub fn commissioning_mode(&self) -> CommissioningMode
bdbCommissioningMode (BDB 5.3.5): the procedure commissioning runs.
Sourcepub fn node_is_on_a_network(&self) -> bool
pub fn node_is_on_a_network(&self) -> bool
bdbNodeIsOnANetwork (BDB 5.3.9): whether the node is on a network.
Sourcepub fn set_tc_link_key_exchange(&self, enabled: bool)
pub fn set_tc_link_key_exchange(&self, enabled: bool)
Whether network steering exchanges the initial Trust Center link key for a unique one (BDB 8.2 step 12); a failed exchange takes the node off the network again.
Disable to stay on the default global TC link key with a trust center that answers neither Node_Desc_req nor REQUEST-KEY, at the cost of leaving the join unauthenticated.
Sourcepub async fn start_initialization_procedure<M: Mlme>(
&self,
device: &ZigbeeDevice<M>,
delay: &mut impl DelayNs,
) -> Result<Option<NlmeJoinConfirm>, NetworkError>
pub async fn start_initialization_procedure<M: Mlme>( &self, device: &ZigbeeDevice<M>, delay: &mut impl DelayNs, ) -> Result<Option<NlmeJoinConfirm>, NetworkError>
Initialization procedure (BDB 7.1).
Persistent state (NIB/AIB) must already be restored by the caller
before constructing the Nlme/[ZigbeeDevice] — that is step 1.
If the node is not on a network, or is not an end device, this
returns Ok(None) and the caller should invoke
Self::network_steering.
Step 4 delegates to [ZigbeeDevice::rejoin], so a Trust Center rejoin
backs up the secure one. If both fail the caller is responsible for
falling back to Self::network_steering after
[ZigbeeDevice::forget_network]; keeping the parent link alive
afterwards is [ZigbeeDevice::link_maintenance].
Sourcepub async fn network_steering<M: Mlme>(
&self,
device: &ZigbeeDevice<M>,
delay: &mut impl DelayNs,
extended_pan_id: IeeeAddress,
channels: Range<u8>,
scan_duration: u8,
capability_information: CapabilityInformation,
) -> Result<NlmeJoinConfirm, NetworkError>
pub async fn network_steering<M: Mlme>( &self, device: &ZigbeeDevice<M>, delay: &mut impl DelayNs, extended_pan_id: IeeeAddress, channels: Range<u8>, scan_duration: u8, capability_information: CapabilityInformation, ) -> Result<NlmeJoinConfirm, NetworkError>
Network steering procedure for a node not on a network (BDB 8.2).
Discovers and joins the network at extended_pan_id, then exchanges
keys with the Trust Center.
The receive loop task must be spawned before calling this: it idles
until the join completes (ZigbeeDevice::rx_loop), then delivers the
Trust Center’s replies for the link key exchange.
Auto Trait Implementations§
impl !Freeze for BaseDeviceBehavior
impl !RefUnwindSafe for BaseDeviceBehavior
impl Send for BaseDeviceBehavior
impl Sync for BaseDeviceBehavior
impl Unpin for BaseDeviceBehavior
impl UnsafeUnpin for BaseDeviceBehavior
impl UnwindSafe for BaseDeviceBehavior
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more