volkszaehler / libsml

Implementation in C of the Smart Message Language (SML) protocol
GNU General Public License v3.0
85 stars 49 forks source link

make DZG workaround more specific #136

Closed jmberg closed 9 months ago

jmberg commented 10 months ago

In #132 and volkszaehler/vzlogger#533 it was reported that there are DZG meters that fall into the range currently deemed broken (all DZG meters with serial numbers before 6000 0000), but aren't actually broken. The reason for this seemed to be that they're a different type than mine that was broken.

Further inquiry with DZG revealed that indeed only DVS74 meters are affected by the encoding issue, and then those only for serial numbers before 6000 0000. They also said that (currently) the serial number ranges

As such, make the workaround detection more specific, and we no longer need to have the check for 6000 0000 either, just need to have a list of affected ranges. To achieve that, refactor the code into a separate function that actually decodes the serial number to an integer, so we can make the comparison more easily and have the list of affected numbers more clearly in the code.

This should fix #132 since the serial number there starts with 4005, so it's clearly not in the affected ranges, as explained by my contact at DZG. For volkszaehler/vzlogger#533 I don't have the serial number, but it's the same type of meter as in #132.

r00t- commented 9 months ago

can't test, but LGTM! thanks for your contributions again!

i'd leave you some time to address my comments (if you like), then i'd merge.

(we really want units-tests for this kind of stuff, but that's beyond the scope of this fix.)

jmberg commented 9 months ago

I pushed but github seems to think about it for a long time

r00t- commented 9 months ago

i haven't the slightest idea why github is refusing to run the workflow... there is no way to run it manually. i suggest you re-push occasionally to check if it's working again.

jmberg commented 9 months ago

It did eventually (after about an hour) show that I force-pushed, so it should be updated now.

r00t- commented 9 months ago

there's still no pipeline run and no option for me to start one :confused: can you try to force-push to a different hash (just add whitespace to the commit message or whatever)?

jmberg commented 9 months ago

Looks better now, perhaps? I pushed a new version w/o any changes.

r00t- commented 9 months ago

@jmberg jmberg force-pushed the dzg-dvs74 branch from 5ea032b to 49426e1

https://github.com/volkszaehler/libsml/pull/136/checks

make DZG workaround more specific 49426e1 succeeded 9 hours ago in 17s

:tada: