Closed t5keeper closed 4 years ago
gnu.io.RXTXPort$SerialInputStream.write(byte[]) has the same problem.
Same here: Reading on a removed device does throw lots of errors "Error 0x5 at src/windows/termios.c(2725): Access denied", but no Exception to catch
Use the https://github.com/NeuronRobotics/nrjavaserial/releases/tag/5.0.3-prerelease nrjavaserial-5.0.3-pre.jar and this code example:
to detect when the hardware is disconnected.
gnu.io.RXTXPort$SerialInputStream.read(byte[]) does not throws IOException when called on closed port.