pub struct ZnpAdapter { /* private fields */ }Expand description
A Z-Stack 3 coordinator.
Implementations§
Source§impl ZnpAdapter
impl ZnpAdapter
Sourcepub async fn connect<T>(
io: T,
config: ClientConfig,
) -> Result<(ZnpAdapter, UnboundedReceiver<AdapterEvent>), HostError>where
T: AsyncRead + AsyncWrite + Send + 'static,
pub async fn connect<T>(
io: T,
config: ClientConfig,
) -> Result<(ZnpAdapter, UnboundedReceiver<AdapterEvent>), HostError>where
T: AsyncRead + AsyncWrite + Send + 'static,
Connect to a Z-Stack coordinator over io. Returns the adapter and
its events.
Trait Implementations§
Source§impl Adapter for ZnpAdapter
impl Adapter for ZnpAdapter
Source§fn info(&self) -> AdapterInfo
fn info(&self) -> AdapterInfo
The NCP’s identity.
Source§async fn start(
&self,
mode: StartMode,
) -> Result<(StartOutcome, NetworkInfo), HostError>
async fn start( &self, mode: StartMode, ) -> Result<(StartOutcome, NetworkInfo), HostError>
Configure the NCP and bring the network up.
Source§async fn permit_join(
&self,
seconds: u8,
join: &JoinPolicy,
) -> Result<(), HostError>
async fn permit_join( &self, seconds: u8, join: &JoinPolicy, ) -> Result<(), HostError>
Open (seconds > 0) or close (0) the coordinator for joining.
Source§async fn add_join_key(&self, ieee: Ieee, key: Key) -> Result<(), HostError>
async fn add_join_key(&self, ieee: Ieee, key: Key) -> Result<(), HostError>
Let the device
ieee join with key (from its install code).Source§async fn send_unicast(
&self,
nwk: NodeId,
aps: Aps,
payload: Vec<u8>,
) -> Result<u16, HostError>
async fn send_unicast( &self, nwk: NodeId, aps: Aps, payload: Vec<u8>, ) -> Result<u16, HostError>
Send an APS unicast. Returns a tag that a later
AdapterEvent::Delivery names.Source§async fn send_broadcast(
&self,
destination: NodeId,
aps: Aps,
payload: Vec<u8>,
) -> Result<(), HostError>
async fn send_broadcast( &self, destination: NodeId, aps: Aps, payload: Vec<u8>, ) -> Result<(), HostError>
Send an APS broadcast to 0xFFFF, 0xFFFD or 0xFFFC.
Source§async fn network_info(&self) -> Result<NetworkInfo, HostError>
async fn network_info(&self) -> Result<NetworkInfo, HostError>
Read the running network’s parameters again (after a channel
change).
Source§async fn active_scan(&self, channel_mask: u32) -> Result<Vec<Beacon>, HostError>
async fn active_scan(&self, channel_mask: u32) -> Result<Vec<Beacon>, HostError>
Listen for other networks’ beacons on the channels in the mask
(an active scan). Works before a network is formed. An NCP family
that cannot scan returns none.
Auto Trait Implementations§
impl !Freeze for ZnpAdapter
impl !RefUnwindSafe for ZnpAdapter
impl !UnwindSafe for ZnpAdapter
impl Send for ZnpAdapter
impl Sync for ZnpAdapter
impl Unpin for ZnpAdapter
impl UnsafeUnpin for ZnpAdapter
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
Mutably borrows from an owned value. Read more