Specifications

Immediate Functions
Most SNAPpy built-ins (when called) quickly do their job, then return. Script execution then continues
with the next line of SNAPpy source code. Although technically they are blocking functions (they do
not return until they have completed), because of their relatively short duration we classify them as
immediate functions.
The following SNAPpy built-ins are classified as immediate:
chr(), errno(), flowControl(), getChannel(), getI2cResult(), getInfo(), getLq(), getMs(), getNetId(),
getStat(), imageName(), i2cInit(), initUart(), int(), len(), localAddr(), mcastSerial(), ord(), peek(),
peekRadio(), poke(), pokeRadio(), random(), readAdc(), readPin(), rpcSourceAddr(), rx(),
setChannel(), setNetId(), setPinDir(), setPinPullup(), setPinSlew(), setRadioRate(), setRate(), spiInit(),
stdinMode(), str(), txPwr(), ucastSerial(), uniConnect(), vmStat(), writePin()
Blocking Functions
Some SNAPpy built-ins take too long to complete to be classified as immediate. Execution of the next
line of script does not occur until these functions complete.
The following functions are classified as blocking:
bist(), call(), cbusRd(), cbusWr(), eraseImage(), getEnergy(), i2cRead(), i2cWrite(), initVm(),
lcdPlot(), loadNvParam(), pulsePin() with a negative duration specified on hardware that supports it,
resetVm(), saveNvParam(), scanEnergy(), sleep(), spiRead(), spiWrite(), spiXfer(), writeChunk()
Non-blocking Functions
Some functions (once initiated) actually complete in the background
. Script execution continues, while
the requested function continues to take place behind the scenes.
The following functions are classified as non-blocking:
callback(), callout(), mcastRpc(), rpc() – the RPC packet is built immediately (if possible), but the
actual sending occurs in the background. Reminder – these functions can return False (with no
background processing) if there is insufficient RAM in which to enqueue the generated packet.
crossConnect() – the actual switchboard configuration takes place immediately, but a crossConnect()
often results in ongoing data transfer afterwards.
monitorPin() – the tagging of the specified pin as “to be monitored” occurs immediately, but then the
actual pin polling takes place in the background.
pulsePin() – the leading edge of the requested pulse is generated immediately, but the “countdown” to
the trailing edge occurs in the background. Calling pulsePin() with a negative duration is blocking.
Page 86 of 202 SNAP Reference Manual Document Number 600-0007K