steveohara / j2mod

Enhanced Modbus library implemented in the Java programming language
Apache License 2.0
267 stars 111 forks source link

Add checks to see if serial port is available during connect #45

Closed steveohara closed 7 years ago

steveohara commented 7 years ago

At the moment, the library can fail with a variety of opaque errors when the user chooses to connect to a port that they don't have access to either through permissions or because it doesn't actually exist. It would be helpful if this situation were detected and a more useful error thrown to indicate the exact problem.

steveohara commented 7 years ago

Added some port checking to the SerialConnection open method with some useful messages if it cannot be opened or does not exist