Fazecast / jSerialComm

Platform-independent serial port access for Java
GNU Lesser General Public License v3.0
1.34k stars 287 forks source link

Code stop after i try to getCommPorts() #576

Open ElPountie opened 1 month ago

ElPountie commented 1 month ago

I'm on windows 10 and i try to get all serial ports but my code just stop without error and even with a try catch i have no exception how i understand what just happend, here is my code :


    public static void initialisePortsSerie() {
        //Parcours et lance le traitement sur chaque port série 
        try {
            System.out.println("Recherche des ports série");

            SerialPort[] ports = SerialPort.getCommPorts();

            System.out.println("Nombre de ports série détectés : " + ports.length);

            if (ports.length == 0) {
                return;
            }

            for (SerialPort port : ports) {
                lecturePortUsb(port);
            }
        } catch (Exception e) {
            System.out.println("Erreur lors de la recherche des ports série : " + e.getMessage());
        }

    }