-
Notifications
You must be signed in to change notification settings - Fork 143
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
mbus_parse_hex -n ignores parsing problem #169
Comments
Update mbus_parse_variable_record so it return NULL if mbus_parse_variable_record return NULL. This makes the program mbus_parse_hex exit with non zero exitcode.
Can someone that has access to the specification check if VIF=0x7B is allowed? According to https://m-bus.com/documentation-wired/08-appendix, I cannot se anything that indicates it. sen_pollutherm.hex after some re-formating
|
I prefer to fix the decoding issue instead of disabling the complete XML output. |
@lategoodbye : Yes, fixing a decoding error is something we ALSO should do, but according to me, that is a separate issue. The suggested update in #170, 7297899, follows the rule "fail early, fail hard" to make sure that problems are noticed and not ignored. This change will make a whole class of potential problems detectable when running tests. |
I've a different opinion about this. There will always a byte the libmbus cannot decode and the public available document won't save us everytime. From a unit test point of view the suggested "fail early, fail hard" is good, but from end user perspective i'm concerned that this could be seen as a regression and the users tend to use older versions. So i prefer to keep the best effort XML output in error case, but make mbus_parse_hex fail with an error code. |
PR #168 executes the code for normalized output, which probably has not been executed so much until now.
As found here #168 (comment)
running
mbus_hex_parse -n sen_pollutherm.hex
causes some errors to be printed but the program returns with exitcode 0.Adding an else statment like this
makes the test output this:
The text was updated successfully, but these errors were encountered: