Fazecast/jSerialComm

How to detect SerialPort that has been disconnected while the Port is Open?

jeyksy opened this issue · 1 comments

Hello,

I am a newbie in programming and currently making a project that uses Serial Communication between a RFID Scanner (Arduino) and Java. I'm already done with the selecting and connecting to the Serial port. My problem is that when testing the program, connected to the Serial Port and I suddenly disconnect the USB Port to my computer, I don't how to detect or the program know that the serial port is already disconnected.

Thank you for the help.

Please refer to the Usage Wiki about Event-Based Programming (https://github.com/Fazecast/jSerialComm/wiki/Event-Based-Reading-Usage-Example). Specifically, look at the "LISTENING_EVENT_PORT_DISCONNECTED" event to receive a notification when a disconnect occurs.