I am using jSSC-2.6.0 in a cross-platform application. The returned port list on Windows computers (32/64-bit) is correct, but the MacOSX application (v10.6 and 10.7) does not return any serial devices. If I look at serial devices manually in the terminal ls /dev/tty.* , I can view three devices. Executing the following line from the jssc example file does not return anything on the same MAC computer:
String[] portNames = SerialPortList.getPortNames();
I can only see a whole bunch of devices, including those that are in the terminal, after use:
String[] portNames = SerialPortList.getPortNames("/dev/", Pattern.compile("tty."));
The disadvantage is that it hangs on the machine for 10 seconds, and on the other machine (10.7) it does not respond after 30 seconds.
Is there a way to reliably connect to a serial device on a MAC using jssc?
source share