Specifications

loadNvParam(id) – Read a Configuration Parameter from NV
This function reads a single parameter from the SNAP Node’s NV storage, and returns it to the caller.
Parameter id specifies which parameter to read. For a full list of all the system (reserved) id values,
refer to section 8. User parameters should have id values in the range 128-254.
See also function saveNvParam().
localAddr() – Get the node’s SNAP address
The localAddr() function returns a string representation of the node’s 3-byte address on the SNAP
network.
This function takes no parameters.
mcastRpc(group, ttl, function, args…) – Multicast RPC
Call a Remote Procedure (make a Remote Procedure Call, or RPC), using multicast messaging. This
means the message could be acted upon by multiple nodes.
Parameter group specifies which nodes should respond to the request. By default, all nodes belong to
the “broadcast” group, group 0x0001. You can configure your nodes to belong to different or
additional groups, refer to NV parameter #5 and NV parameter #6 in section 8 on Node Configuration
Parameters.
Parameter ttl specifies the Time To Live (TTL) for the request. This basically specifies how many
hops the message is allowed to make before being discarded.
Parameter function specifies which remote function to be invoked. This could be a built-in SNAPpy
function, or one defined by the SNAPpy script currently loaded into that node.
NOTE! Except for built-ins, what the function actually does depends on what script is loaded
into each node.
The specified function will be invoked with the parameters specified by args, if any args are present.
For example, mcastRpc(1, 3, 'writePin', 0, True) will ask all nodes in the broadcast
group and within 3 hops of the sender to do a writePin(0, True).
mcastRpc(3, 5, 'reboot') will ask all nodes within 5 hops and belonging to group 1 (0x0001
or 0000000000000001b) or group 2 (0x0002 or 0000000000000010b) to do a reboot().
Notice that groups are bits, not numbers. See the details on NV parameter 5 and NV parameter 6 in
section 8 for more details.
SNAP Reference Manual Document Number 600-0007K Page 61 of 202