Hi, Mikko!
I commented out #define DLMS_IGNORE_MALLOC in gxignore.h and get errors in client.c file.
src/client.c:571: error: request for member ‘data’ in something not a structure or union
/src/gxserializer.c: In function ‘ser_set2’:
/src/client.c: In function ‘cl_parseApplicationAssociationResponse’:
/src/client.c:571:67: error: request for member ‘data’ in something not a structure or union
571 | (ret = bb_set(secret, settings->cipher.systemTitle.data, settings->cipher.systemTitle.size)) != 0 ||
|
client.c:571: error: request for member ‘size’ in something not a structure or union
../../gurux_lib_c/src/client.c:571:102: error: request for member ‘size’ in something not a structure or union
571 | (ret = bb_set(secret, settings->cipher.systemTitle.data, settings->cipher.systemTitle.size)) != 0 ||
|
src/client.c:1801: error: ‘value’ undeclared (first use in this function)
../../gurux_lib_c/src/client.c: In function ‘cl_writeList’:
../../gurux_lib_c/src/client.c:1801:34: error: ‘value’ undeclared (first use in this function)
1801 | bb_set2(pdu, value->byteArr, 0, value->byteArr->size);
| ^~~~~
src/client.c:1801:34: note: each undeclared identifier is reported only once for each function it appears in
/src/client.c:2296: error: expected declaration or statement at end of input
../../gurux_lib_c/src/client.c:2296:1: error: expected declaration or statement at end of input
2296 | }
Also in IAR project compile errors in function cl_writeLN().
Without #define - OK. In IAR projects only many warnings like "Warning[Pe188]: enumerated type mixed with another type src\client.c 1974", Warning[Pe550]: variable "ret" was set but never used src\gxsetignoremalloc.c 5306
How to fix compile errors? Thanks!
I found the bug in row 572…
I found the bug in row 572 in client.c:
I think should be write like this:
#ifndef DLMS_IGNORE_MALLOC
(ret = bb_set(secret, settings->cipher.systemTitle.data, settings->cipher.systemTitle.size)) != 0 ||
#else
(ret = bb_set(secret, settings->cipher.systemTitle, sizeof(settings->cipher.systemTitle))) != 0 ||
#endif
Btw, i think skipped #define…
Btw, i think skipped #define key word for DLMS_IGNORE_SERIALIZER in gxignore.h file.
Hi, You can't use DLMS…
Hi,
You can't use DLMS_IGNORE_MALLOC with client. It will cause all kind of problems because the client doesn't know what kind of data the meter is returning.
You can read simple data types, but complex data types require malloc.
This is fixed so the client is not available if the DLMS_IGNORE_MALLOC is defined.
BR,
Mikko