For the purpose of my thesis, all I need is a simple Java program to listen to a serial port (comm port). It doesn’t even have to send data to the serial port – it just has to listen, as the GPS device I have just continually echos its current location to anyone listening.
Failed Attempt 1 (~3 hrs)
So I found some Java code which appears to connect to a serial port. I haven’t been able to test it fully, but the code seems like it will work (I can see the GPS data coming in from the Garmin 18X GPS device). It’s a fairly small amount of code as well. This very old program is available at http://alumni.media.mit.edu/~benres/simpleserial/.
It also requires the “javax.comm.*” library which was hard to find, but I eventually found it by searching http://search.sun.com/main/index.jsp?col=main-downloads-products&qt=comm and following the download link at http://www.sun.com/download/index.jsp?cat=Application%20Development&tab=3. For whatever reason, Oracle makes you register to be able to download it.
After further inspection, comm.jar does not have Windows support.
After further testing, this program doesn’t seem to work correctly – it only hears one echo from the GPS device and not an echo every second. I’ll now look at http://www.rxtx.org.
Failed Attempt 2 (~ 30 minutes)
I looked at http://www.rxtx.org. It looks complicated. I kept looking.
Success (~30 minutes)
SerTerm is a very simple terminal program written in Java. It does nothing extra, it isn’t fancy, and it’s just what I need.