0

I'm using Ubuntu 12.04 on virtual box and tried to do serial communication first with javax.comm and rxtx. In both approaches getPortIdentifiers().toString() just returns "gnu.io.CommPortEnumerator@20d10a" and no actual list of the available ports.

any ideas?

PogoMips
  • 3,497
  • 8
  • 27
  • 34
  • Is the serial port visible to the virtual box? – Peter Lawrey Oct 09 '12 at 15:10
  • 1
    Yes, I already used the serial ports in C programs on the virtual box. worked fine – PogoMips Oct 09 '12 at 15:12
  • It seems that gnu.io.CommPortEnumerator just hasn't got its own implementation for toString(), so it's using the default from java.lang.Object. Did you try calling the hasMoreElements() and nextElement() for it? Peeked from source in here: https://www.knopflerfish.org/svn/knopflerfish.org/trunk/osgi/bundles_opt/serial/rxtxcomm/src/gnu/io/CommPortEnumerator.java – esaj Oct 09 '12 at 15:25
  • Did not try that yet but I used CommPortIdentifier.getPortIdentifier("/dev/sp3virtual"); which through a NoSuchPortException. This is the port I also used to read and write from in C. – PogoMips Oct 09 '12 at 15:28
  • CommPortIdentifier pid = (CommPortIdentifier)ports.nextElement(); System.out.println(pid.getName()); this also produces no output. – PogoMips Oct 09 '12 at 15:34

0 Answers0