Welcome! Log In Create A New Profile

Advanced

diff for using rxtx (gnu.io) serial library

Posted by jmarsden 
diff for using rxtx (gnu.io) serial library
May 24, 2007 11:52AM
All it takes to use the rxtx library instead of the Sun javax.comm one for serial comms is
to install the library (!), and then to change one .java file as follows:

Index: org/reprap/comms/snap/SNAPCommunicator.java
===================================================================
--- org/reprap/comms/snap/SNAPCommunicator.java (revision 606)
+++ org/reprap/comms/snap/SNAPCommunicator.java (working copy)
@@ -4,11 +4,11 @@
import java.io.InputStream;
import java.io.OutputStream;

-import javax.comm.CommPortIdentifier;
-import javax.comm.NoSuchPortException;
-import javax.comm.PortInUseException;
-import javax.comm.SerialPort;
-import javax.comm.UnsupportedCommOperationException;
+import gnu.io.CommPortIdentifier;
+import gnu.io.NoSuchPortException;
+import gnu.io.PortInUseException;
+import gnu.io.SerialPort;
+import gnu.io.UnsupportedCommOperationException;

import org.reprap.Device;
import org.reprap.Preferences;

Basically a straight search and replace of javax.comm. with gnu.io. , and then rebuild the project.

Note that so far this definitely builds and runs, but is untested on real physical serial hardware. If you try it with real Reprap eletronics, please post letting everyone know whether it works for you, and what computing platform you are working with.

Jonathan
Re: diff for using rxtx (gnu.io) serial library
May 24, 2007 03:40PM
Hey Jonathan,

That looks pretty interesting. I am currently trying to get my boards to work with the original software - and have some issues with that - but when that works, I will try the rxtx library as well using your patch. Keep up the good work!

Joost
Sorry, only registered users may post in this forum.

Click here to login