Specifications

print – the textual output is generated in a blocking fashion, but the output is sent in the background.
reboot() – this function schedules a reboot in approximately 200 milliseconds, then allows script
execution to continue until the reboot occurs.
setSegments() – the new pattern is defined immediately, but the actual periodic refresh occurs in the
background.
Non-blocking Functions and SNAPpy Hooks
Some non-blocking functions result in “hook” (HOOK_xxx) callback functions being called, if they
are defined in your script.
Use of function… …can result in
rpc(), mcastRpc() HOOK_RPC_SENT
monitorPin() HOOK_GPIN
print HOOK_STDOUT
crossConnect(), uniConnect() HOOK_STDIN
SNAPpy Scripting Hints
The following are some helpful hints for developing custom SNAPpy scripts for your nodes. These are
not in any particular order.
Beware of Case SensitiViTy
Like “desktop” Python, SNAPpy scripts are case sensitive – “foo” is not the same as “Foo”.
Also, because SNAPpy is a dynamically typed language, it is perfectly legal to invent a new variable
on-the-fly, and assign a value to it. So, the following SNAPpy code snippet:
foo = 2
Foo = "The Larch"
…results in two variables being created, and “foo” still has the original value of 2.
Case sensitivity applies to function names as well as variable names.
linkQuality = getlq()
…is a script error unless you have defined a function getlq(). The built-in function is not named
“getlq”.
linkQuality = getLq()
…is probably what you want.
SNAP Reference Manual Document Number 600-0007K Page 87 of 202