mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-24 16:53:50 +02:00
Bug 480077 Be more lenient on the *usbserial* port names.
Need to add support for /dev/tty.wchusbserial*.
Change-Id: I219070b7464eff1781baa57882c93d4b70032fb2
(cherry picked from commit 652943dfdf
)
This commit is contained in:
parent
98dee4063b
commit
a657aaa132
1 changed files with 9 additions and 8 deletions
|
@ -175,7 +175,8 @@ public class SerialPort {
|
|||
/**
|
||||
* Create a serial port that connect to the given serial device.
|
||||
*
|
||||
* @param portName name for the serial device.
|
||||
* @param portName
|
||||
* name for the serial device.
|
||||
*/
|
||||
public SerialPort(String portName) {
|
||||
this.portName = portName;
|
||||
|
@ -221,7 +222,7 @@ public class SerialPort {
|
|||
public static String[] list() throws IOException {
|
||||
String osName = System.getProperty("os.name"); //$NON-NLS-1$
|
||||
if (osName.equals("Mac OS X")) { //$NON-NLS-1$
|
||||
return listDevs(Pattern.compile("tty\\.(usbserial|usbmodem).*")); //$NON-NLS-1$
|
||||
return listDevs(Pattern.compile("tty\\..*(usbserial|usbmodem).*")); //$NON-NLS-1$
|
||||
} else if (osName.equals("Linux")) { //$NON-NLS-1$
|
||||
return listDevs(Pattern.compile("ttyUSB.*")); //$NON-NLS-1$
|
||||
} else if (osName.startsWith("Windows")) { //$NON-NLS-1$
|
||||
|
|
Loading…
Add table
Reference in a new issue