Specifications

def pong():
print 'got a response!'
Now imagine node “B” is loaded with a script containing the following function:
def ping():
rpc(rpcSourceAddr(),'pong')
Node A can invoke function “ping” on node B, but it has to know node B’s address to do so:
rpc(node_B_address_goes_here, 'ping')
When node B receives the RPC request packet, it will invoke local function ‘ping’, which will
generate the remote ‘pong’ request. Notice that node B can respond to a ‘ping’ request from any node.
All SNAP Network Addresses are three-byte strings.
This function takes no parameters.
rx(isEnabled) – Turn radio receiver on/off
This function allows you to power down the radio, extending battery life in applications that do not
actually need the radio (or only need it intermittently).
NOTE! If you turn the radio off (using rx(False)), then you will not receive any more radio
traffic!
The radio defaults to ON in SNAP Nodes. If you invoke rx(False), the radio will be powered down.
Invoking rx(True) will power the radio back up.
In addition, sending any data over the radio will automatically wake the radio back up.
To be clear: a node can wake up its own radio by attempting to transmit. A node’s radio will not be
woken up by transmissions from other nodes. This function does not return a value.
saveNvParam(id, obj) – Save data into NV memory
This function lets you store individual pieces of data into the SNAP node’s Non-Volatile (NV)
memory.
Parameter id specifies which “key” to store the obj parameter under. NV parameter IDs 0, 255, and 1-
127 all have pre-assigned meanings (refer to section 8). IDs 128-254 are user defined, your script can
store whatever you want, under any ID (128-254) that you want. See section 8 for a listing of the
available parameters.
The obj parameter should be the data you want to store, and can be a boolean, an integer, a string, or a
None.
SNAP Reference Manual Document Number 600-0007K Page 69 of 202