BenLenest / java-simple-serial-connector

Automatically exported from code.google.com/p/java-simple-serial-connector
0 stars 0 forks source link

Port List not returning MacOSX #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. be on Mac OS X
2. if you call serialPortList.getPortNames()
3. it will not return anything because of the file rules it has for returning a 
file

What is the expected output? What do you see instead?
I expected to see ports.  instead I got A zero length array

What version of the product are you using? On what operating system?
0.9  MacOSX

Please provide any additional information below.
It would be helpful if we were allowed to specify the rules for finding ports.
Obviously I just went and found the ports needed myself.

This could also be an improvement for people trying to use a virtual port.

Btw I love this project.  It is very useful and very easy!

Original issue reported on code.google.com by Dtrac...@gmail.com on 24 Oct 2012 at 9:25

Attachments:

GoogleCodeExporter commented 8 years ago
I was having the same issue, and I had to look at the code in the library, 
specifically SerialPortList.java.
It was the file extension // "tty.(serial.*|usbserial.*)") that I changed to 
"cu.*".
You could also use tty.* but it comes up with a very long list.
attached:
 - Screenshot of the culprit method
 - jSSC.jar include

Original comment by sa...@uw.edu on 14 Mar 2013 at 4:55

Attachments:

GoogleCodeExporter commented 8 years ago
For Mac, you're best off specifying your own regex using the 
getPortNames(pattern) method. The default regex in SerialPortList.java for Mac 
won't match the kinds of serial port devices you find on the latest versions.

Original comment by s.donald...@gmail.com on 17 Jun 2014 at 11:08

GoogleCodeExporter commented 8 years ago
I'm not sure why he has this exact problem since drivers usually install both 
the tty and cu devices. But it seems to me that jSSC should be catering for 
people who want to find either the cu or tty devices. They are there for 
different reasons. tty is supposed to be for devices that connect to you 
(terminals) and cu is supposed to be connecting out to other devices. Since 
terminals are pretty obsolete most people should I guess be using cu*. But 
either way, the jSSC interface should specify what sort of connection you want.

getPortNames(SerialPortList.OUTGOING) for example for cu or 
getPortNames(SerialPortList.INCOMING)

as an example interface. If Windows does the same thing for both cases, that's 
ok.

And if as the previous writer says that newer devices won't be found, can 
someone fix that? From my personal experience this isn't true, but what's the 
point of a device independent library that doesn't keep up to date in keeping 
it device independent? If we all start inserting our own regexps to hack around 
that, we might as well just start writing our own libraries for each platform.

Original comment by xpusosto...@gmail.com on 22 May 2015 at 10:39