Specifications

setChannel(channel) – Specify which channel the node is on
For all SNAP devices, the setChannel() function takes a number in the 0-15 range to specify which
frequency (or range of frequencies) the device should use for its communications. Refer to the
description for function getChannel() for more on this topic.
On 802.15.4/2.4 GHz devices, channels 0-15 correspond to 802.15.4 channel 11-26.
For 900 MHz devices running FHSS (frequency-hopping) firmware, the channel normally specifies
which range of 25 frequencies SNAP should use to distribute its transmissions across the frequency
range. However you can set the channel to any value up to 65, and need to do so to get meaningful
data from the getEnergy() function. See the getEnergy() function for more details on this topic.
Note that this function changes the “live” channel setting, and the effect only lasts until the next
reboot or power cycle. You can also use saveNvParam() to save the “persisted” channel setting
into NV parameter 4 if you want the node to stay on that channel.
This function does not return a value.
setNetId(networkId) – Specify which Network ID the node is on
The setNetId() function takes a Network ID parameter 0-0xFFFF representing which SNAP Network
ID the node should switch to. Note that Network ID 0xFFFF is considered a “wildcard” network ID
(matches all nodes), and you normally should only use network IDs of 0-0xFFFE.
The Network ID and the channel are what determine which radios can communicate with each other in
a wireless network. Radios must be set to the same channel and Network ID in order to communicate
over the air. Nodes communicating over a serial link pay no attention to the channel and Network ID.
See also getNetId(). This function returns no value.
Note that this function changes the “live” network ID setting, and the effect only lasts until the
next reboot or power cycle. You can also use saveNvParam() to save the “persisted” network ID
setting in NV parameter 3 if you want the node to stay on that network ID after its next reboot.
setPinDir(pin, isOutput) – Set direction (input or output) for a pin
This function should be called for each IO pin you want to use as either a digital input or digital output
in your application.
Parameter pin specifies which IO pin to configure. Parameter isOutput makes the pin be an output
when True, or an input when False.
SNAP Reference Manual Document Number 600-0007K Page 71 of 202