-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
(RFC-compliance: Issue813) A violation regarding the specifications for the Read Exception Status. #833
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
base: master
Are you sure you want to change the base?
Conversation
|
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
src/modbus.c
Outdated
| // fprintf(stderr, "FIXME Not implemented\n"); | ||
| // } | ||
| // errno = ENOPROTOOPT; | ||
| // return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commented out code should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/modbus.c
Outdated
| MODBUS_EXCEPTION_ILLEGAL_FUNCTION, | ||
| rsp, | ||
| TRUE, | ||
| "FIXME Not implemented: 0x%0X\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we here know what function call is not implemented, I would use a human readable string eg. "READ EXCEPTION STATUS (0x07)" (or maybe re-use the libraries "MODBUS_FC_READ_EXCEPTION_STATUS") in the debug output, rather than only the numeric function id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
src/modbus.c
Outdated
| rsp, | ||
| TRUE, | ||
| "FIXME Not implemented: READ EXCEPTION STATUS (0x07)\n", | ||
| function); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function argument is not needed anymore. We can drop it.
I also recommend to squash all the commits into a single one and then force push to this branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhei Thank you for your suggestion.
We have squashed all the commits into a single one and force-pushed to this branch.
|
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
mhei
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested, but LGTM.
We respectfully submit this pull request in order to improve the consistency between libmodbus and its specification.
Why is this PR needed?
In the previous implementation of libmodbus, when modbus clients send the valid but unimplemented command READ EXCEPTION STATUS, there is no response from the server. Therefore, clients will be confused. They are unable to distinguish between an unimplemented condition and a syntax error.
Why can this PR be safely merged?
We have only added the expected handling for unimplemented command types, without modifying any existing functionality. Therefore, our PR can be safely merged without affecting compatibility with actual clients.
We totally respect the priority: Real-world client compatibility > Theoretical RFC compliance, and are more than happy to assist in improving RFC compliance based on this foundation.
Thank you for your attention, and we look forward to your response : )