Не читает з ком порта java

вот хотел считать данные с ком порта но возникла проблема что оно банально не читает. Данные 100% там есть! Кто сталкивался помогите плиз. Код:

public class Main {

private static SerialPort serialPort;

public static void main(String[] args) {
    serialPort = new SerialPort("COM3");
    try {
        serialPort.openPort();
        Thread.sleep(2000);
        serialPort.setParams(SerialPort.BAUDRATE_57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
        serialPort.writeBytes("Test".getBytes());
        serialPort.setEventsMask(SerialPort.MASK_RXCHAR);
        serialPort.addEventListener(new EventListener());
    }
    catch (SerialPortException | InterruptedException ex) {
        System.out.println(ex);
    }
}

private static class EventListener implements SerialPortEventListener {

    public void serialEvent(SerialPortEvent event) {
        if(event.isRXCHAR() && event.getEventValue() == 8){
            try {
                byte[] buffer = serialPort.readBytes(8);
                for(int i = 0; i < buffer.length; i++){
                    System.out.println("Output" + buffer[i]);
                }
                serialPort.closePort();
            }
            catch (SerialPortException ex) {
                System.out.println(ex);
            }
        }
    }
}

Ответы (0 шт):