Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Compile Errors In Client.c

Compile errors in client.c

Profile picture for user Dmitry
By Dmitry , 28 October, 2024
Forums
Gurux.DLMS

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!

Profile picture for user Dmitry

Dmitry

1 year 7 months ago

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

Profile picture for user Dmitry

Dmitry

1 year 7 months ago

Btw, i think skipped #define…

Btw, i think skipped #define key word for DLMS_IGNORE_SERIALIZER in gxignore.h file.

Profile picture for user Kurumi

Kurumi

1 year 7 months ago

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

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin