[title]Gadgeteer Serial Port Pass-Through[/title]
http://code.tinyclr.com/project/450/gadgeteer-serial-port-pass-through/
[line]
This snippet allows you to pass-through serial date to/from USB CDC from/to the serial port.
The code assumes that an XBee module is connected to socket #8 of a FEZ Spider and that the system is connected to a PC via a USB client board.
The on-board debug LED is flashed whenever data is sent to the XBee.
You may have to reset the FEZ Spider after starting the debugger to make it connect.
Please note that it is a little slow.
You will need these CDC drivers:
http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/GHI_NETMF_Interface_with_CDC.zip
Required assembly references:
GHIElectronics.NETMF.Hardware
GHIElectronics.NETMF.Hardware.EMX
GHIElectronics.NETMF.USBClient
Microsoft.SPOT.Hardware
Microsoft.SPOT.Hardware.SerialPort
Microsoft.SPOT.Native
mscorlib