[Rxtx] RXTX No errors, but no ports?

James A R Brown james at enrogen.com
Mon May 31 12:22:34 MDT 2010


Hi,

I was trying to test RXTX on my Linux machine (x86_64) before taking the
next step with jamod. Its a NB swing project with the JAR included.

To start with I thought I would just simply query the system for
available ports (machine has /dev/ttyS0 ok, although no hard port). Code
snippet below.

I put the relevant x86_64 so in /usr/lib64 and for failsafe. When that
did not work I also put he i686 in /usr/lib. When that did not work I
also put the JAR into [JDK home]/jre/lib/ext

But, no ports are listed and from beginning to end there is no info in
the console aside from this.

run:
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
Experimental:  JNI_OnLoad called.
BUILD SUCCESSFUL (total time: 31 minutes 13 seconds)

Does anyone have any suggestions on say getting a more verbose output or
ideas?

Thanks

James


    @Action
    public void getComPorts() {
        Enumeration ports = CommPortIdentifier.getPortIdentifiers();
       jTextArea2.setText(jTextArea2.getText() + "\n" + "Output");
        while (ports.hasMoreElements()) {
            CommPortIdentifier port = (CommPortIdentifier)
ports.nextElement();
            String type;
            switch (port.getPortType()) {
                case CommPortIdentifier.PORT_PARALLEL:
                    type = "Parallel";
                    break;
                case CommPortIdentifier.PORT_SERIAL:
                    type = "Serial";
                    break;
                default: /// Shouldn't happen
                    type = "Unknown";
                    break;
            }
            jTextArea2.setText(jTextArea2.getText() + "\n" +
port.getName() + ": " + type);
        }
    }





More information about the Rxtx mailing list