Package jssc
Class SerialPortList
java.lang.Object
jssc.SerialPortList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
Get sorted array of serial ports in the system using default settings:
Search path
Windows - ""(always ignored)
Linux - "/dev/"
Solaris - "/dev/term/"
MacOSX - "/dev/"
RegExp
Windows - ""
Linux - "(ttyS|ttyUSB|ttyACM|ttyAMA|rfcomm)[0-9]{1,3}"
Solaris - "[0-9]*|[a-z]*"
MacOSX - "tty.(serial|usbserial|usbmodem).*"static String[]
getPortNames
(String searchPath) Get sorted array of serial ports in the system located on searchPathstatic String[]
getPortNames
(String searchPath, Comparator<String> comparator) Get sorted array of serial ports in the system located on searchPath and sorted by comparatorstatic String[]
getPortNames
(String searchPath, Pattern pattern) Get sorted array of serial ports in the system located on searchPath, matched patternstatic String[]
getPortNames
(String searchPath, Pattern pattern, Comparator<String> comparator) Get sorted array of serial ports in the system located on searchPath, matched pattern and sorted by comparatorstatic String[]
getPortNames
(Comparator<String> comparator) Get sorted array of serial ports in the system matched patternstatic String[]
getPortNames
(Pattern pattern) Get sorted array of serial ports in the system matched patternstatic String[]
getPortNames
(Pattern pattern, Comparator<String> comparator) Get sorted array of serial ports in the system matched pattern and sorted by comparator
-
Constructor Details
-
SerialPortList
public SerialPortList()
-
-
Method Details
-
getPortNames
Get sorted array of serial ports in the system using default settings:
Search path
Windows - ""(always ignored)
Linux - "/dev/"
Solaris - "/dev/term/"
MacOSX - "/dev/"
RegExp
Windows - ""
Linux - "(ttyS|ttyUSB|ttyACM|ttyAMA|rfcomm)[0-9]{1,3}"
Solaris - "[0-9]*|[a-z]*"
MacOSX - "tty.(serial|usbserial|usbmodem).*"- Returns:
- String array. If there is no ports in the system String[] with zero length will be returned (since jSSC-0.8 in previous versions null will be returned)
-
getPortNames
Get sorted array of serial ports in the system located on searchPath- Parameters:
searchPath
- Path for searching serial ports (not null)
The default search paths:
Linux, MacOSX: /dev/
Solaris: /dev/term/
Windows: this parameter ingored- Returns:
- String array. If there is no ports in the system String[]
- Since:
- 2.3.0
-
getPortNames
Get sorted array of serial ports in the system matched pattern- Parameters:
pattern
- RegExp pattern for matching port names (not null)- Returns:
- String array. If there is no ports in the system String[]
- Since:
- 2.3.0
-
getPortNames
Get sorted array of serial ports in the system matched pattern- Parameters:
comparator
- Comparator for sotring port names (not null)- Returns:
- String array. If there is no ports in the system String[]
- Since:
- 2.3.0
-
getPortNames
Get sorted array of serial ports in the system located on searchPath, matched pattern- Parameters:
searchPath
- Path for searching serial ports (not null)
The default search paths:
Linux, MacOSX: /dev/
Solaris: /dev/term/
Windows: this parameter ingoredpattern
- RegExp pattern for matching port names (not null)- Returns:
- String array. If there is no ports in the system String[]
- Since:
- 2.3.0
-
getPortNames
Get sorted array of serial ports in the system located on searchPath and sorted by comparator- Parameters:
searchPath
- Path for searching serial ports (not null)
The default search paths:
Linux, MacOSX: /dev/
Solaris: /dev/term/
Windows: this parameter ingoredcomparator
- Comparator for sotring port names (not null)- Returns:
- String array. If there is no ports in the system String[]
- Since:
- 2.3.0
-
getPortNames
Get sorted array of serial ports in the system matched pattern and sorted by comparator- Parameters:
pattern
- RegExp pattern for matching port names (not null)comparator
- Comparator for sotring port names (not null)- Returns:
- String array. If there is no ports in the system String[]
- Since:
- 2.3.0
-
getPortNames
public static String[] getPortNames(String searchPath, Pattern pattern, Comparator<String> comparator) Get sorted array of serial ports in the system located on searchPath, matched pattern and sorted by comparator- Parameters:
searchPath
- Path for searching serial ports (not null)
The default search paths:
Linux, MacOSX: /dev/
Solaris: /dev/term/
Windows: this parameter ingoredpattern
- RegExp pattern for matching port names (not null)comparator
- Comparator for sotring port names (not null)- Returns:
- String array. If there is no ports in the system String[]
- Since:
- 2.3.0
-