Closed fredrik-sk closed 4 years ago
Update: Some more research showed that this was introduced by commit 2f9fa5ccc8aa032556ab77b7cafcb24670b6bf8d, the code was updated but not the tests. Reverting that commit makes the test run clean again.
I will look into this some more.
Added a comment: According to wikipedia ( https://en.wikipedia.org/wiki/Binary-coded_decimal , section Packed BCD), 0xF0 should be interpreted as a positve number.
https://github.com/rscada/libmbus/commit/2f9fa5ccc8aa032556ab77b7cafcb24670b6bf8d#r39755040
I think, i've found a solution. Unfortunately we have a regression in #151 which must be fixed first.
I also have such a case ... I brought my branch of libmbus which is used to buil "node-mbus" to the current status of the master but my Node-mbs tests fail because also here I have one case where the "SlaveInformation.Id" field changes.
I already have the "improved BCD decoding" commit in too!
My Test use the following hex: 689292680801723E020005434C1202130000008C1004521200008C1104521200008C2004334477018C21043344770102FDC9FF01ED0002FDDBFF01200002ACFF014F008240ACFF01EEFF02FDC9FF02E70002FDDBFF02230002ACFF0251008240ACFF02F1FF02FDC9FF03E40002FDDBFF03450002ACFF03A0008240ACFF03E0FF02FF68000002ACFF0040018240ACFF00BFFF01FF1304D916
And here link to test error https://travis-ci.org/github/Apollon77/node-mbus/jobs/703332935#L1114
Branch of libmbus is https://github.com/Apollon77/libmbus/commits/build-windows
@Apollon77 Your hex contains 3E020005 which is actually slave id 500023E. I'm not sure it's allowed to have hex digits in a slave id and i don't know this comes from a real device. But make libmbus hiding this issue to make your tests succeed doesn't make sense to me.
So please describe your expectations.
@lategoodbye if it is that way I'm fine ... then this change is "simply because decoding was broken before" and so it is fixed now :-) I was just wondering which is right ... When I remember correctly I had that "data string" from a real device. Then I fix the test expectation!
I consider this as fixed
I created a Dockerfile to run the tests, and ran the tests on an unmodified master. And I got a bunch of printouts (diff).
https://github.com/fredrik-sk/libmbus/runs/742450655?check_suite_focus=true
EDIT: Here is a copy of the printouts.