Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Closing a SerialPort causes an IOException to be thrown #3
When closing a SerialPort, the thread that is currently reading the port will come back with an IOException. This occurs at least on Windows using a BufferedSerialInputStream, but not using a SimpleSerialInputStream.
Also, when closing a serialport that is using a SimpleSerialInputStream, a 0 gets returned when the serial port closes - it should be -1, as that is what an InputStream uses to say that there is an EOF.
Updated BufferedSerialInputStream to optionally throw an IOException when an InterruptedException is thrown. Added a function on the SerialPort to set this functionality. Fixed the inputstream returning 0 when the serial port is closed(at least on Windows), will now return -1. Needs to be tested on Linux. POM should no longer try to sign by default, only when we release.