public static String [ ] getAvailablePortNames ( ) { SerialPort [ ] ports = SerialPort . getCommPorts ( ) ; String [ ] portNames = new String [ ports . length ] ; for ( int i = 0 ; i < portNames . length ; i ++ ) { String systemPortName = ports [ i ] . getSystemPortName ( ) ; portNames [ i ] = systemPortName ; } return portNames ; }
Getter for the available serial ports .