leFrame union

A frame for holding parts of a response. Define a little-endian frame as a union - that is a special class type that can hold only one of its non-static data members at a time.

With avr-gcc (Arduino's compiler), integer and floating point variables are all physically stored in memory in little-endian byte order, so this union is all that is needed to translate modbus byte data into the other data forms.

Public variables

byte Byte
4 bytes will occupy 4 bytes
char Char
4 characters will occupy 4 bytes
uint16_t uInt16
2 16bit unsigned integers will occupy 4 bytes
int16_t Int16
2 16bit integers will occupy 4 bytes
uint32_t uInt32
a single 32bit unsigned integer occupies 4 bytes
int32_t Int32
a single 32bit integer occupies 4 bytes
float Float32
a single float occupies 4 bytes