Closed dammarco closed 1 year ago
Nice idea. Lets put the decoders somewhere accessible for library consumers, too!
Note: https://github.com/grid-x/modbus/pull/65 needs to be merged before this PR
@andig yeah, I'll do that in another PR afterwards to keep it more clean ;) We have a cool encoding/decoding package in our app that we now can use here as well :)
We have a ton of encodings in https://github.com/evcc-io/evcc but our naming is odd. Maybe start an entirely new repo for encoding? Would be happy to contribute!
Yes, we are internally working on a separate encoding/decode repo already. We might use it here later :)
@tretmar feel free to spy on https://github.com/volkszaehler/mbmd/tree/master/encoding and don't forget the strings ;)
Will do that @andig thanks 😊
We often have to use "mid-little-endian" encoding for 32bit registers but the CLI tool didn't offer support for it. With this PR, I propose to add new CLI flags that can force the order for reading and writing registers.
The supported orders are: "AB", "BA", "ABCD", "DCBA", "BADC", and "CDAB".
I also found out that writing a float32 was not possible as the encoding was wrong. Thus, I replaced the encoding mechanism here as well.
Note: Since this is now extending the Modbus CLI significantly, I will do a PR afterwards to generate the binaries easier :D