pub trait Adapter:
Send
+ Sync
+ 'static {
// Required methods
fn info(&self) -> AdapterInfo;
fn start(
&self,
mode: StartMode,
) -> impl Future<Output = Result<(StartOutcome, NetworkInfo), HostError>> + Send;
fn permit_join(
&self,
seconds: u8,
policy: &JoinPolicy,
) -> impl Future<Output = Result<(), HostError>> + Send;
fn add_join_key(
&self,
ieee: Ieee,
key: Key,
) -> impl Future<Output = Result<(), HostError>> + Send;
fn send_unicast(
&self,
nwk: NodeId,
aps: Aps,
payload: Vec<u8>,
) -> impl Future<Output = Result<u16, HostError>> + Send;
fn send_broadcast(
&self,
destination: NodeId,
aps: Aps,
payload: Vec<u8>,
) -> impl Future<Output = Result<(), HostError>> + Send;
fn network_info(
&self,
) -> impl Future<Output = Result<NetworkInfo, HostError>> + Send;
fn backup(&self) -> impl Future<Output = Result<Backup, HostError>> + Send;
fn active_scan(
&self,
channel_mask: u32,
) -> impl Future<Output = Result<Vec<Beacon>, HostError>> + Send;
fn leave(&self) -> impl Future<Output = Result<(), HostError>> + Send;
fn energy_scan(
&self,
channel_mask: u32,
) -> impl Future<Output = Result<Vec<(u8, i8)>, HostError>> + Send;
}Expand description
A network co-processor family. Every method’s future is Send so the
host can call it from any task.
Required Methods§
Sourcefn info(&self) -> AdapterInfo
fn info(&self) -> AdapterInfo
The NCP’s identity.
Sourcefn start(
&self,
mode: StartMode,
) -> impl Future<Output = Result<(StartOutcome, NetworkInfo), HostError>> + Send
fn start( &self, mode: StartMode, ) -> impl Future<Output = Result<(StartOutcome, NetworkInfo), HostError>> + Send
Configure the NCP and bring the network up.
Sourcefn permit_join(
&self,
seconds: u8,
policy: &JoinPolicy,
) -> impl Future<Output = Result<(), HostError>> + Send
fn permit_join( &self, seconds: u8, policy: &JoinPolicy, ) -> impl Future<Output = Result<(), HostError>> + Send
Open (seconds > 0) or close (0) the coordinator for joining.
Sourcefn add_join_key(
&self,
ieee: Ieee,
key: Key,
) -> impl Future<Output = Result<(), HostError>> + Send
fn add_join_key( &self, ieee: Ieee, key: Key, ) -> impl Future<Output = Result<(), HostError>> + Send
Let the device ieee join with key (from its install code).
Sourcefn send_unicast(
&self,
nwk: NodeId,
aps: Aps,
payload: Vec<u8>,
) -> impl Future<Output = Result<u16, HostError>> + Send
fn send_unicast( &self, nwk: NodeId, aps: Aps, payload: Vec<u8>, ) -> impl Future<Output = Result<u16, HostError>> + Send
Send an APS unicast. Returns a tag that a later
AdapterEvent::Delivery names.
Sourcefn send_broadcast(
&self,
destination: NodeId,
aps: Aps,
payload: Vec<u8>,
) -> impl Future<Output = Result<(), HostError>> + Send
fn send_broadcast( &self, destination: NodeId, aps: Aps, payload: Vec<u8>, ) -> impl Future<Output = Result<(), HostError>> + Send
Send an APS broadcast to 0xFFFF, 0xFFFD or 0xFFFC.
Sourcefn network_info(
&self,
) -> impl Future<Output = Result<NetworkInfo, HostError>> + Send
fn network_info( &self, ) -> impl Future<Output = Result<NetworkInfo, HostError>> + Send
Read the running network’s parameters again (after a channel change).
Sourcefn backup(&self) -> impl Future<Output = Result<Backup, HostError>> + Send
fn backup(&self) -> impl Future<Output = Result<Backup, HostError>> + Send
Export everything a restore needs.
Sourcefn active_scan(
&self,
channel_mask: u32,
) -> impl Future<Output = Result<Vec<Beacon>, HostError>> + Send
fn active_scan( &self, channel_mask: u32, ) -> impl Future<Output = Result<Vec<Beacon>, HostError>> + Send
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".