Wednesday, May 29, 2013

The [USB] light begins to dawn...

The SPARCL12 USB-to-serial problem turns out to be simple.  But also potentially complex.
You can use the LSUSB command in a terminal window to see what USB devices you have currently connected to your computer.  It does not matter what Linux distribution you are using.
The Linux kernel has built-in support for many of them (FTDI, PL2303, etc.)
SO... it looks to me that what I need to do in SPOCS is~
1) upon reading SPOCS.SET, look at the serial port address as specified.  Is it ttySx or ttyUSBx?
2) If it is ttySx, the routines we have already will work.
3) If it is ttyUSBx, now we need to see what the device is - FTDI? PL2303?
4) Use appropriate API calls to manage that serial port.

For our friends who are running older hardware, usually they will have built-in ttySx ports on the mainboard.  The problem is, once we realize we are dealing with a USB device, to determine which chipset it is, and call the appropriate code.
We happen to have several different USB-to-serial ports here, including those mentioned above.  So our implementation should cover most of the USB bases.  We shall see.  This is one of the fun parts of the project...researching something.  There is always material available on the 'net to help you along.
Wait a minute!  One thing I noticed, is that Minicom always works over a USB-to-serial device.  So, we download a copy of the Minicom source...Thank you, Mr. Miquel van Smoorenburg, for releasing Minicom under the GPL.  Now, to see how he deals with serial ports, and how it can help SPOCS.  This is what Free and Open Source Software is all about!
P.S. What's Minicom?  An Open Source Terminal/serial communications program, good for testing. 
More later!