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
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