Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
lsiepel 2024-12-07 16:44:46 +01:00 committed by GitHub
parent 5d89c9a885
commit 37d910d318
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,10 @@ public enum DSMRErrorStatus {
* Serial port doesn't support the configured settings.
*/
PORT_NOT_COMPATIBLE(true),
/**
* Serial port time out or illegal state.
*/
PORT_PORT_TIMEOUT(false),
/**
* Reading data from the serial port failed.
*/

View File

@ -172,6 +172,10 @@ public class DSMRSerialConnector extends DSMRBaseConnector implements SerialPort
logger.warn("Possible bug because a new serial port value was set during opening new port.");
errorStatus = DSMRErrorStatus.PORT_INTERNAL_ERROR;
}
} catch (final IllegalStateException ise) {
logger.debug("Failed communicating, probably time out", ise);
errorStatus = DSMRErrorStatus.PORT_PORT_TIMEOUT;
} catch (final IOException ioe) {
logger.debug("Failed to get inputstream for serialPort", ioe);