Check the protocol version to see if it is supported:
Check the NCP version to see if a firmware update may be necessary:
Check interface type to make sure that it is what we expect:
If the host supports using vendor-specific commands, the vendor should be verified before using them:
Fetch the capability list so that we know what features this NCP supports:
If the NCP supports CAP_NET_SAVE, then we go ahead and recall the network:
We make the assumption that the NCP is not currently associated with a network.
Set the network properties, if they were not already set:
CMD_VALUE_SET:PROP_PHY_CHAN
CMD_VALUE_IS:PROP_PHY_CHAN
CMD_VALUE_SET:PROP_NET_XPANID
CMD_VALUE_IS:PROP_NET_XPANID
CMD_VALUE_SET:PROP_MAC_15_4_PANID
CMD_VALUE_IS:PROP_MAC_15_4_PANID
CMD_VALUE_SET:PROP_NET_NETWORK_NAME
CMD_VALUE_IS:PROP_NET_NETWORK_NAME
CMD_VALUE_SET:PROP_NET_MASTER_KEY
CMD_VALUE_IS:PROP_NET_MASTER_KEY
CMD_VALUE_SET:PROP_NET_KEY_SEQUENCE_COUNTER
CMD_VALUE_IS:PROP_NET_KEY_SEQUENCE_COUNTER
CMD_VALUE_SET:PROP_NET_KEY_SWITCH_GUARDTIME
CMD_VALUE_IS:PROP_NET_KEY_SWITCH_GUARDTIME
Bring the network interface up:
Bring the routing stack up:
Some asynchronous events from the NCP:
This example session is identical to the above session up to the point where we set PROP_NET_IF_UP to true. From there, the behavior changes.
Bring the routing stack up:
Some asynchronous events from the NCP:
Now let's save the network settings to NVRAM:
This example session is identical to the above session up to the point where we set PROP_NET_IF_UP to true. From there, the behavior changes.
Bring the routing stack up:
Some asynchronous events from the NCP:
TBD
Recall the saved network if you haven't already done so:
Bring the network interface up:
Bring the routing stack up:
Some asynchronous events from the NCP:
Then jump to (#ncp-initialization).
TBD
TBD
This assumes that the NCP has been initialized.
Optionally set the channel:
Set the filter mode:
Enable the raw stream:
Enable the PHY directly:
Now we will get raw 802.15.4 packets asynchronously on PROP_STREAM_RAW:
This mode may be entered even when associated with a network. In that case, you should set PROP_MAC_PROMISCUOUS_MODE
to MAC_PROMISCUOUS_MODE_PROMISCUOUS
or MAC_PROMISCUOUS_MODE_NORMAL
, so that you can avoid receiving packets from other networks or that are destined for other nodes.