can2mqtt
can2mqtt copied to clipboard
configurable endianess?
trafficstars
Status quo is that all conversions for and to integers (signed and unsigned) expect and assume little endian. The config does not reflect that. It is just silenlty like this.
I have two ideas how to approach this
1. Global flag
Here we add a new global flag that from this point makes all integer operations behave as either little or big endian Advantages:
- full backwards compatibility Disadvantages:
- no setting per topic
- once we introduce this flag we are stuck with it
2. Convertmodes
Advantages:
- setting per topic
- backwards compatibility possible Disadvantages:
- two convertmodes
uint82asciianduintle82asciithat achieve the same thing, very ugly, but probably a price one has to pay, otherwise I do not see what shall be reported in the logfile. In total that would mean three endianness options nothing, le and be while the first two are actually the same