Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dsmr] Fix IllegalStateException in rfc2217 connector #17854

Merged
merged 2 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ public void open(final DSMRSerialSettings portSettings) {
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);

Expand Down