pub enum Callback {
Show 17 variants
StackStatus {
status: Status,
},
MessageSent {
status: Status,
kind: u8,
destination: NodeId,
aps: ApsFrame,
tag: u16,
},
IncomingMessage {
kind: u8,
aps: ApsFrame,
info: RxPacketInfo,
payload: Vec<u8>,
},
TrustCenterJoin {
node_id: NodeId,
ieee: Ieee,
status: u8,
decision: u8,
parent: NodeId,
},
ChildJoin {
index: u8,
joining: bool,
node_id: NodeId,
ieee: Ieee,
node_type: u8,
},
IncomingRouteRecord {
source: NodeId,
ieee: Ieee,
last_hop_lqi: u8,
last_hop_rssi: i8,
relays: Vec<NodeId>,
},
ZigbeeKeyEstablishment {
partner: Ieee,
status: u8,
},
EnergyScanResult {
channel: u8,
max_rssi: i8,
},
NetworkFound {
channel: u8,
pan_id: u16,
extended_pan_id: ExtPanId,
allowing_join: bool,
stack_profile: u8,
nwk_update_id: u8,
lqi: u8,
rssi: i8,
},
ScanComplete {
channel: u8,
status: Status,
},
IdConflict {
node_id: NodeId,
},
IncomingRouteError {
status: Status,
target: NodeId,
},
IncomingNetworkStatus {
code: u8,
target: NodeId,
},
IncomingManyToOneRouteRequest {
source: NodeId,
ieee: Ieee,
cost: u8,
},
StackTokenChanged {
token: u16,
},
NoCallbacks,
Other {
frame_id: u16,
params: Vec<u8>,
},
}Expand description
A callback from the NCP.
Variants§
StackStatus
The network came up, went down, opened or closed for joining.
MessageSent
The outcome of a sendUnicast or sendBroadcast.
Fields
kind: u8crate::ids::outgoing type.
IncomingMessage
A message for the host.
TrustCenterJoin
A device joined, rejoined or left (trust center view).
ChildJoin
A child of the coordinator joined or left.
IncomingRouteRecord
A route record: the path a device’s message took to the coordinator.
Fields
ZigbeeKeyEstablishment
Key establishment with a partner progressed or failed.
EnergyScanResult
One channel’s result of an energy scan.
NetworkFound
An active scan heard a network’s beacon.
Fields
ScanComplete
A scan finished (or failed on channel).
IdConflict
Two devices share a network address.
IncomingRouteError
A route error arrived.
IncomingNetworkStatus
A network status command arrived.
IncomingManyToOneRouteRequest
A concentrator’s many-to-one route request was heard.
StackTokenChanged
A stack token changed.
NoCallbacks
The NCP had no callbacks waiting.
Other
A callback this crate does not decode, passed through.
Implementations§
Source§impl Callback
impl Callback
Sourcepub fn decode(
v: ProtocolVersion,
frame_id: u16,
params: &[u8],
) -> Result<Callback, DecodeError>
pub fn decode( v: ProtocolVersion, frame_id: u16, params: &[u8], ) -> Result<Callback, DecodeError>
Decode a callback. Unknown frame ids become Callback::Other;
malformed known ones are errors.