package de.lazyzero.kkMulticopterFlashTool.utils;

import gnu.io.CommPort;
import gnu.io.CommPortIdentifier;
import gnu.io.PortInUseException;

import java.util.Enumeration;
import java.util.HashSet;

public class PortScanner {
	 static void listPorts()
	    {
	        java.util.Enumeration<CommPortIdentifier> portEnum = CommPortIdentifier.getPortIdentifiers();
	        while ( portEnum.hasMoreElements() ) 
	        {
	            CommPortIdentifier portIdentifier = portEnum.nextElement();
	            if (portIdentifier.getPortType()==CommPortIdentifier.PORT_SERIAL)
	            System.out.println(portIdentifier.getName());
	        }        
	    }
	    
	    
	    public static void main (String[] args) {
	    	listPorts();
	    }
}

