Made the base class a template class, that statically allocates the internal buffer at compile-time
Made the library header only (could not make it with source file as template classes must be defined in header file)
Removed all the data helper functions and made them standalone, so that they don't get linked in when not used
Create a Measurement_t structure which can be added to the encoder buffer, this Measurement_t supports for multiple data_types but is the size of the largest datatype (9-bytes), This is the artifact of using an union.
The union Measurement_t helps to convert the different data-types to raw-bytes for transmission without the need of manual bit-shifts/ops.
Made all the separate data helper functions static inline, so that it goes from this:
What has changed
Measurement_t
structure which can be added to the encoder buffer, thisMeasurement_t
supports for multiple data_types but is the size of the largest datatype (9-bytes), This is the artifact of using an union.Measurement_t
helps to convert the different data-types to raw-bytes for transmission without the need of manual bit-shifts/ops.Measurement_t data = SetDigitalOutput(0);
It basically optimizes away all the function structure, and converts it in compile-time to a variable assignment.