pub enum WirelessNetCtl<'a, Q> {
Commissioning(NetworkType),
Operational(&'a Q),
}Expand description
A composite wireless network controller that is the SAME concrete type during both the (BLE) commissioning phase and the operational (Thread/Wifi) phase.
This exists purely to avoid building two structurally-different Matter handler
chains per device. InteractionModel::handle and every generated cluster handler
adaptor are monomorphized over the whole handler-chain tuple type; if the
net-ctl slot has a different type per phase, the entire dispatch tree is
compiled twice (~tens of KiB of duplicated .text on embedded targets).
By using WirelessNetCtl<Q> in both phases — Commissioning before the
operational controller exists, Operational(&Q) afterwards — the chain type
is identical across phases and the dispatch tree monomorphizes once.
The Commissioning variant reproduces the behavior of the former
NoopWirelessNetCtl: scan errors with InvalidAction, connect only
checks the creds match the network type, and every diag returns its default.
The Operational variant delegates to the real controller Q.
Q is named identically at every phase via the wireless driver’s associated
net-ctl type (see the Thread/Gatt driver traits), so even the
commissioning phase — which has no controller value — can still name the type.
Variants§
Commissioning(NetworkType)
Commissioning phase: no operational controller yet (BLE only).
Operational(&'a Q)
Operational phase: delegate to the real controller.
Trait Implementations§
impl<Q> DynBase for WirelessNetCtl<'_, Q>
sync-mutex only.Source§impl<Q> NetChangeNotif for WirelessNetCtl<'_, Q>where
Q: NetChangeNotif,
impl<Q> NetChangeNotif for WirelessNetCtl<'_, Q>where
Q: NetChangeNotif,
Source§async fn wait_changed(&self)
async fn wait_changed(&self)
Source§impl<Q> NetCtl for WirelessNetCtl<'_, Q>where
Q: NetCtl,
impl<Q> NetCtl for WirelessNetCtl<'_, Q>where
Q: NetCtl,
Source§fn net_type(&self) -> NetworkType
fn net_type(&self) -> NetworkType
Source§fn connect_max_time_seconds(&self) -> u8
fn connect_max_time_seconds(&self) -> u8
Source§fn scan_max_time_seconds(&self) -> u8
fn scan_max_time_seconds(&self) -> u8
Source§fn supported_wifi_bands<F>(&self, f: F) -> Result<(), Error>
fn supported_wifi_bands<F>(&self, f: F) -> Result<(), Error>
Source§fn supported_thread_features(&self) -> ThreadCapabilitiesBitmap
fn supported_thread_features(&self) -> ThreadCapabilitiesBitmap
Source§fn thread_version(&self) -> u16
fn thread_version(&self) -> u16
Source§async fn scan<F>(&self, network: Option<&[u8]>, f: F) -> Result<(), NetCtlError>
async fn scan<F>(&self, network: Option<&[u8]>, f: F) -> Result<(), NetCtlError>
Source§async fn connect(&self, creds: &WirelessCreds<'_>) -> Result<(), NetCtlError>
async fn connect(&self, creds: &WirelessCreds<'_>) -> Result<(), NetCtlError>
Source§impl<Q> ThreadDiag for WirelessNetCtl<'_, Q>where
Q: ThreadDiag,
impl<Q> ThreadDiag for WirelessNetCtl<'_, Q>where
Q: ThreadDiag,
fn channel(&self) -> Result<Option<u16>, Error>
fn routing_role(&self) -> Result<Option<RoutingRoleEnum>, Error>
fn network_name( &self, f: &mut dyn FnMut(Option<&str>) -> Result<(), Error>, ) -> Result<(), Error>
fn pan_id(&self) -> Result<Option<u16>, Error>
fn extended_pan_id(&self) -> Result<Option<u64>, Error>
fn mesh_local_prefix( &self, f: &mut dyn FnMut(Option<&[u8]>) -> Result<(), Error>, ) -> Result<(), Error>
fn neighbor_table( &self, f: &mut dyn FnMut(&NeighborTable) -> Result<(), Error>, ) -> Result<(), Error>
fn route_table( &self, f: &mut dyn FnMut(&RouteTable) -> Result<(), Error>, ) -> Result<(), Error>
fn partition_id(&self) -> Result<Option<u32>, Error>
fn weighting(&self) -> Result<Option<u16>, Error>
fn data_version(&self) -> Result<Option<u16>, Error>
fn stable_data_version(&self) -> Result<Option<u16>, Error>
fn leader_router_id(&self) -> Result<Option<u8>, Error>
fn ext_address(&self) -> Result<Option<u64>, Error>
fn rloc_16(&self) -> Result<Option<u16>, Error>
fn security_policy(&self) -> Result<Option<SecurityPolicy>, Error>
fn channel_page0_mask( &self, f: &mut dyn FnMut(Option<&[u8]>) -> Result<(), Error>, ) -> Result<(), Error>
fn operational_dataset_components( &self, f: &mut dyn FnMut(Option<&OperationalDatasetComponents>) -> Result<(), Error>, ) -> Result<(), Error>
fn active_network_faults_list( &self, f: &mut dyn FnMut(NetworkFaultEnum) -> Result<(), Error>, ) -> Result<(), Error>
Source§impl<Q> WifiDiag for WirelessNetCtl<'_, Q>where
Q: WifiDiag,
impl<Q> WifiDiag for WirelessNetCtl<'_, Q>where
Q: WifiDiag,
fn bssid( &self, f: &mut dyn FnMut(Option<&[u8]>) -> Result<(), Error>, ) -> Result<(), Error>
fn security_type(&self) -> Result<Nullable<SecurityTypeEnum>, Error>
fn wi_fi_version(&self) -> Result<Nullable<WiFiVersionEnum>, Error>
fn channel_number(&self) -> Result<Nullable<u16>, Error>
fn rssi(&self) -> Result<Nullable<i8>, Error>
Source§impl<Q> WirelessDiag for WirelessNetCtl<'_, Q>where
Q: WirelessDiag,
impl<Q> WirelessDiag for WirelessNetCtl<'_, Q>where
Q: WirelessDiag,
Auto Trait Implementations§
impl<'a, Q> Freeze for WirelessNetCtl<'a, Q>
impl<'a, Q> RefUnwindSafe for WirelessNetCtl<'a, Q>where
Q: RefUnwindSafe,
impl<'a, Q> Send for WirelessNetCtl<'a, Q>where
Q: Sync,
impl<'a, Q> Sync for WirelessNetCtl<'a, Q>where
Q: Sync,
impl<'a, Q> Unpin for WirelessNetCtl<'a, Q>
impl<'a, Q> UnsafeUnpin for WirelessNetCtl<'a, Q>
impl<'a, Q> UnwindSafe for WirelessNetCtl<'a, Q>where
Q: RefUnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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