code: 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;
      }
docs: Getter for the available serial ports.
  
  @return the available serial ports system names.