PDA

View Full Version : What are DS_STDIO and DS_PACKET_SERIAL?


kbanks
11-05-2008, 08:25 AM
I can’t find any mention of what DS_STDIO or DS_PACKET_SERIAL relate to port wise.

For starters, refer to pages 23-24 of the SNAP Reference Manual...

DS_STDIO represents SNAPpy’s “console”. When you “print” from a SNAPpy script, it goes to the DS_STDIO.

Characters that come into the DS_STDIO get processed by the SNAPpy script.

The key is to realize that DS_STDIO represents one extra level of indirection.

By using the crossConnect() or uniConnect() built-ins within your SNAPpy script, you choose what DS_STDIO actually connects to.


crossConnect(DS_UART0, DS_STDIO) # now my SNAPpy script is interacting with UART0

crossConnect(DS_UART1, DS_STDIO) # now my SNAPpy script is interacting with UART1 instead


As for DS_PACKET_SERIAL, this is the “logical connection point” for Packet Serial, the serial port version of SNAP.

The Packet Serial protocol is how Portal and SNAP Gateway talk to SNAP nodes.


crossConnect(DS_UART0, DS_PACKET_SERIAL) # now my SNAP node can talk to Portal on UART0

crossConnect(DS_UART1, DS_PACKET_SERIAL) # now my SNAP node can talk to Portal on UART1

mgenti
11-05-2008, 08:32 AM
The values for DS_STDIO and DS_PACKET_SERIAL are stored in the switchboard.py file located in the synapse snappyImages directory.

In your SNAPpy script you can do the following to access the values:

from synapse.switchboard import *