User manual

For example, to configure UART1 for Transparent (Wireless Serial) mode, put the following statement in your
SNAPpy startup handler:
crossConnect(DS_UART1, DS_TRANSPARENT)
The following table is a matrix of possible Switchboard connecons. Each cell label describes the “mode”
enabled by row-column cross-connect. Note that the “DS_” prefixes have been omied to save space.
UART0 UART1
TRANSPARE
NT
STDIO PACKET_SERIAL
UART0 Loopback Crossover
Wireless
Serial
Local
Terminal
Local SNAP Connect, Portal,
or another SNAP Node
UART1 Crossover Loopback
Wireless
Serial
Local
Terminal
Local SNAP Connect, Portal,
or Another SNAP Node
TRANSPARENT
Wireless
Serial
Wireless
Serial
Loopback
Remote
Terminal
Remote SNAP Connect
Any given data sink can be the desnaon for mulple data sources, but a data source can only be connected to
a single desnaon. Therefore, if you cross-connect two elements you cannot direct serial data from either of
those elements to addionally go anywhere else, but you can sll direct other elements to be routed to one of
the elements specified in the cross-connect.
The DS_ERROR element is a data source, but cannot be a data sink. Uniconnecng DS_ERROR to a desnaon
causes any error messages generated by your program to be routed to that sink. In this way, you can (for
example) route error messages to Portal while allowing other serial data to be directed to a UART.
You can configure Portal (using the preferences menu) to intercept just errors, non-error text, or both when you
intercept STDIO to the applicaon. Refer to the Portal Reference Manual.
Loopback
A command like crossConnect(DS_UART0, DS_UART0) will setup an automac loopback. Incoming
characters will automacally be sent back out the same interface.
Crossover
A command like crossConnect(DS_UART0, DS_UART1) will send characters received on UART0 out UART1,
and characters received on UART1 out UART0.
Wireless Serial
As menoned previously, a command of: crossConnect(DS_UART0, DS_TRANSPARENT)will send characters
received on UART0 Over The Air (OTA).
Where the data will actually be sent is controlled by other SNAPpy built-ins. Refer to the API secon of the SNAP
Reference Manual regarding the ucastSerial() and mcastSerial() funcons.
22 SNAP® Network Operang System