Hi,
I'm porting the DLMS.c to esp32 IDF and I have a conflict on the definition of uint32_t
In gxint.h, uint32_t is define unsigned long
In stdint.h, uint32_t is a typedef unsigned int
gxint.h check for a define but in stdint.h the uint32_t is a typedef, the gxint.h defines the uint32_t and I have a conflict because the define is different from the typedef.
This can be solved changing the line 44 in gxint.h
"#ifndef uint32_t" to "#if !(defined uint32_t) && !(defined _UINT32_T_DECLARED)"
I don't know if this is the most generic solution, but it works for my case.
Because of the change in the definition of uint32_t, you need to change the creation of 2 variables in the dlms.c file
line 3281: "unsigned long id;" to "uint32_t id;"
line 5028: "unsigned long value = 0;" to "uint32_t value = 0;"
I extended the fix to the
I extended the fix to the other types
#if !(defined uint16_t) && !(defined _UINT16_T_DECLARED)
#define uint16_t unsigned short
#endif //uint16_t
#if !(defined uint32_t) && !(defined _UINT32_T_DECLARED)
#define uint32_t unsigned long
#endif //uint32_t
#if !(defined uint64_t) && !(defined _UINT64_T_DECLARED)
#define uint64_t unsigned long long
#endif //uint64_t
#if !(defined int16_t) && !(defined _INT16_T_DECLARED)
#define int16_t short
#endif //uint16_t
#if !(defined int32_t) && !(defined _INT32_T_DECLARED)
#define int32_t long
#endif //int32_t
#if !(defined int64_t) && !(defined _INT64_T_DECLARED)
#define int64_t long long
#endif //int64_t