can2mqtt icon indicating copy to clipboard operation
can2mqtt copied to clipboard

configurable endianess?

Open mxmxchere opened this issue 1 year ago • 0 comments
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 uint82ascii and uintle82ascii that 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

mxmxchere avatar Nov 13 '24 23:11 mxmxchere