jssc

## Class SerialPortList

- java.lang.Object
- - jssc.SerialPortList

-     public class SerialPortList
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SerialPortList()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String[]` | `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).*"
    `static java.lang.String[]` | `getPortNames(java.util.Comparator<java.lang.String> comparator)` Get sorted array of serial ports in the system matched pattern
    `static java.lang.String[]` | `getPortNames(java.util.regex.Pattern pattern)` Get sorted array of serial ports in the system matched pattern
    `static java.lang.String[]` | `getPortNames(java.util.regex.Pattern pattern, java.util.Comparator<java.lang.String> comparator)` Get sorted array of serial ports in the system matched pattern and sorted by comparator
    `static java.lang.String[]` | `getPortNames(java.lang.String searchPath)` Get sorted array of serial ports in the system located on searchPath
    `static java.lang.String[]` | `getPortNames(java.lang.String searchPath, java.util.Comparator<java.lang.String> comparator)` Get sorted array of serial ports in the system located on searchPath and sorted by comparator
    `static java.lang.String[]` | `getPortNames(java.lang.String searchPath, java.util.regex.Pattern pattern)` Get sorted array of serial ports in the system located on searchPath, matched pattern
    `static java.lang.String[]` | `getPortNames(java.lang.String searchPath, java.util.regex.Pattern pattern, java.util.Comparator<java.lang.String> comparator)` Get sorted array of serial ports in the system located on searchPath, matched pattern and sorted by comparator

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SerialPortList

          public SerialPortList()

  - ### Method Detail

    - #### getPortNames

          public static java.lang.String[] 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

          public static java.lang.String[] getPortNames(java.lang.String searchPath)

      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

          public static java.lang.String[] getPortNames(java.util.regex.Pattern pattern)

      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

          public static java.lang.String[] getPortNames(java.util.Comparator<java.lang.String> comparator)

      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

          public static java.lang.String[] getPortNames(java.lang.String searchPath,
                                        java.util.regex.Pattern pattern)

      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 ingored
        `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

          public static java.lang.String[] getPortNames(java.lang.String searchPath,
                                        java.util.Comparator<java.lang.String> comparator)

      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 ingored
        `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 java.lang.String[] getPortNames(java.util.regex.Pattern pattern,
                                        java.util.Comparator<java.lang.String> comparator)

      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 java.lang.String[] getPortNames(java.lang.String searchPath,
                                        java.util.regex.Pattern pattern,
                                        java.util.Comparator<java.lang.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 ingored
        `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