Specifications

This function returns a byte string consisting of the bits that were shifted in (as the bits specified by
parameter byteStr were shifted out).
More background information on using SPI is in section 6.
stdinMode(mode, echo) – Set console input options
This function controls how serial data gets presented to your SNAPpy script (via the HOOK_STDIN),
and how it appears to the user.
Parameter mode chooses between line-at-a-time (mode = 0) or character based (mode = 1).
In “line mode” (mode 0, the default), characters are buffered up until either a Carriage Return (CR) or
Line Feed (LF) are received. The complete string is then given to your SNAPpy script in a single
HOOK_STDIN invocation. Note that either character can trigger the handoff, so if your terminal (or
terminal emulator) is automatically adding extra CR or LF characters, you will see additional empty
strings (“”) passed to your script.
The character sequence A B C CR LF looks like two lines of input to SNAPpy.
In “character mode” (mode 1), characters are passed to your SNAPpy script as soon as they become
available. If characters are being received fast enough, it still is possible for your script to receive more
than one character at a time; they are just not buffered waiting for a CR or LF.
While your node is in line mode, SNAP reserves one “medium” string buffer to accept incoming data
from standard-in. If your script is heavy on string usage but does not make use of the HOOK_STDIN
hook, you can set the standard-in mode to character mode and recover the use of the medium string.
Parameter echo is a Boolean parameter that controls whether or not the SNAP firmware will “echo”
(retransmit) the received characters back out (so that the user can see what they are typing).
This function does not return a value.
str(object) – Return the string representation of an object
Function str() returns a string based on the value of the object you give it.
For example, str(123) = ‘123’, str(True) = ‘True’, and str(‘hello’) = ‘hello’.
txPwr(power) – Set Radio TX power level
The radio on the SNAP node defaults to maximum power. Function txPwr() lets you reduce the power
level from this default maximum.
SNAP Reference Manual Document Number 600-0007K Page 77 of 202