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. Node
  3. GX_ENUM(x):possible Wrong Assignement

GX_ENUM(x):possible wrong assignement

By andale8592 , 24 September, 2025
Forums
Gurux DLMS for ANSI C

Hi,
i notice that: #define GX_ENUM(X) GX_UNION(&X, cVal, DLMS_DATA_TYPE_ENUM), in https://github.com/Gurux/GuruxDLMS.c/blob/master/development/include/va…
I think that should be: #define GX_ENUM(X) GX_UNION(&X, bVal, DLMS_DATA_TYPE_ENUM), (like in https://github.com/Gurux/GuruxDLMS.c/blob/master/development/src/varian…).
Moreover the DLMS Blue Book specification states the enum should range [0,255].

Thanks,
Alessandro

Profile picture for user Kurumi

Kurumi

11 months 4 weeks ago

Hi Alessandro, That doesn't…

Hi Alessandro,

That doesn't affect anything. The byte where the value is saved is the same.

I understand your concern, however, and this will change for the next release.

BR,
Mikko

andale8592

11 months 4 weeks ago

Thank you Mikko, also for GX…

Thank you Mikko, also for GX_STRUCT in similar way, in my opinioni, should be:

#define GX_STRUCT(X, VALUE_) GX_UNION2(&X, Arr= &VALUE_, (DLMS_DATA_TYPE)(DLMS_DATA_TYPE_BYREF | DLMS_DATA_TYPE_STRUCTURE), 0, 0) instead of pVal = &Arr.
I know is the same, but from a developer point of view kown that the strcuture is implemented as a variantArray is more transparent.

Thanks,
Alessandro

andale8592

11 months 4 weeks ago

Thank you Mikko, also for GX…

Thank you Mikko, also for GX_STRUCT in similar way, in my opinioni, should be:

#define GX_STRUCT(X, VALUE_) GX_UNION2(&X, Arr= &VALUE_, (DLMS_DATA_TYPE)(DLMS_DATA_TYPE_BYREF | DLMS_DATA_TYPE_STRUCTURE), 0, 0) instead of pVal = &Arr.
I know is the same, but from a developer point of view kown that the strcuture is implemented as a variantArray is more transparent.

Thanks,
Alessandro

Profile picture for user Kurumi

Kurumi

11 months 3 weeks ago

Hi Alessandro, This is now…

Hi Alessandro,

This is now updated to version 9.0.2509.2601.

BR,
Mikko

andale8592

11 months 3 weeks ago

Hi Mikko, i don't see the…

Hi Mikko,
i don't see the change/commit in https://github.com/Gurux/GuruxDLMS.c/blob/master/development/include/va…

Profile picture for user Kurumi

Kurumi

11 months 3 weeks ago

Hi, Varian.h was left out of…

Hi,

Varian.h was left out of the GitHub commit by accident. It's now there.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin