Skip to main content

ZnpAdapter

Struct ZnpAdapter 

Source
pub struct ZnpAdapter { /* private fields */ }
Expand description

A Z-Stack 3 coordinator.

Implementations§

Source§

impl ZnpAdapter

Source

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.

Source

pub fn version(&self) -> Version

The firmware’s version.

Trait Implementations§

Source§

impl Adapter for ZnpAdapter

Source§

fn info(&self) -> AdapterInfo

The NCP’s identity.
Source§

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>

Open (seconds > 0) or close (0) the coordinator for joining.
Source§

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>

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>

Send an APS broadcast to 0xFFFF, 0xFFFD or 0xFFFC.
Source§

async fn network_info(&self) -> Result<NetworkInfo, HostError>

Read the running network’s parameters again (after a channel change).
Source§

async fn backup(&self) -> Result<Backup, HostError>

Export everything a restore needs.
Source§

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

async fn leave(&self) -> Result<(), HostError>

Leave the NCP’s network and erase it (keys, PAN ids, frame counter) from the NCP, whether or not it was started.
Source§

async fn energy_scan( &self, channel_mask: u32, ) -> Result<Vec<(u8, i8)>, HostError>

Measure each channel’s energy; returns (channel, max RSSI dBm).
Source§

impl Debug for ZnpAdapter

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more