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

feat: avoid error out on frame with invalid manufacturer code #27

Merged

Conversation

dragonnn
Copy link
Contributor

@dragonnn dragonnn commented Nov 7, 2024

I am trying to move my project from pymeterbus and some heatmeters my project has to detect don't have filed out manufacturer code (it contains 0x00 bytes) with leads to m-bus-parser to error out and not be able to parse any DataRecords. I modified the code to not error out and be able to continue.
I suspect storing a Result inside a struct isn't the nicest option but this way the information that something happened while parsing the manufacturer code is still retained. I am open to other ideas how to handle that.

@maebli
Copy link
Owner

maebli commented Nov 16, 2024

Hey, thanks for the PR! Sorry I only just saw it now. I will take a look :)

I want to understand you issue, you would like to be able to get the parsed result for an illegal manufacturer, am I correct?

Can you provide an example payload maybe?

@dragonnn
Copy link
Contributor Author

I want to understand you issue, you would like to be able to get the parsed result for an illegal manufacturer, am I correct?

Exactly,
the payload that does this can be found in my other PR https://github.com/maebli/m-bus-parser/pull/29/files#diff-cd9539fdb6e41539f62bd90927ed31026413e7c20f5ecf794429cd1c6a33e5cbR847
when you put that payload into https://dev-lab.github.io/tmbus/tmbus.htm you get this:
image

@maebli maebli merged commit becbe50 into maebli:main Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants