smartheim / wakaamaNode

lwM2M library based on Wakaama for PlattformIO/cmake with easy object API
https://openhab-nodes.github.io/wakaamaNode/
MIT License
27 stars 19 forks source link

New 'ResourceRaw' class constructor #22

Closed taubel closed 5 years ago

taubel commented 5 years ago

Lwm2m resources that are of type 'int' fail to build, when using a system where 'int32_t' type is equal to 'long int'. The problem is that in such case the compiler can't find a correct template for the 'ResourceRaw' class builder, and the 'delete' method gets called. One example is 'arm' processor systems. You can see the default 'int32_t' type with command 'arm-none-eabi-gcc -dM -E - < /dev/null | grep __INT32'. My solution is a new, dynamic constructor, which takes into account if types 'int' and 'int32_t' are equal, thus making it compatible with other systems like 'esp'.