User manual
Local Terminal
A command like crossConnect(DS_UART0, DS_STDIO) will send characters received on UART0 to your
SNAPpy script for processing. The characters will be reported to your script via your specified HOOK_STDIN
handler. Any text “printed” (using the print statement) will be sent out that same serial port.
This makes it possible to implement applicaons like a Command Line Interface.
Remote Terminal
A command like crossConnect(DS_TRANSPARENT, DS_STDIO) will send characters received wirelessly to
your SNAPpy script for processing. Characters “printed” by your SNAPpy script will be sent back out over the air.
This is oen used in conjuncon with a
crossConnect(DS_UARTx, DS_TRANSPARENT) in some other SNAP
Node.
Packet Serial
The last column of the table shows the effect of various combinaons using DS_PACKET_SERIAL.
A command like
crossConnect(DS_UART0, DS_PACKET_SERIAL) will configure the unit to talk Synapse’s
Packet Serial protocol over UART0. This enables RS-232 connecon to a PC running Portal or SNAP Connect.
It also allows serial connecon to another SNAP Node, if the appropriate “cross-over” cable is used.
This allows “bridging” of separate SNAP Networks (networks that are on different channels and/or different
Network IDs, or two nodes that work in different radio frequency ranges).
A command like
crossConnect(DS_UART1, DS_PACKET_SERIAL) will configure the unit to talk Synapse’s
Packet Serial protocol over UART1. On some SNAP demonstraon boards, one UART will be a true RS-232 serial
connecon, and the other will be a USB serial connecon.
Refer to the API documentaon on crossConnect() in the SNAP Reference Manual for more details.
Debugging
Applicaon development with SNAP offers an unprecedented level of interacvity in embedded programming.
Using Portal you can quickly upload code, test, adjust, and try again. Some ps and techniques for debugging:
• Make use of the “print” statement to verify control flow and values. (Be sure to connect STDIO to a
UART or Intercept STDOUT with Portal.)
• When using Portal’s Intercept feature, you’ll get source line-number informaon, and symbolic error-
codes.
• Invoke “unit-test” script funcons by execung them directly from the Snappy Modules Tree in Portal’s
Node Info panel.
• Use the included SNAP Sniffer to observe the RPC calls between devices.
SNAP® Network Operang System 23