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 9 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 9 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 9 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

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin