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. Can Not Read String Object

Can not read string object

By plotnikov.av , 18 April, 2023
Forums
Gurux.DLMS

Hi.
Using client example from ANSI C can't read OBIS object with string value:

if ((ret = cl_read(&connection->settings, object, attributeOrdinal, &data)) != 0 ||
(ret = com_readDataBlock(connection, &data, &reply)) != 0 ||
(ret = cl_updateValue(&connection->settings, object, attributeOrdinal, &reply.dataValue)) != 0)

This code works well with integers returning right value in reply.dataValue but it is empty if reading string.

I can't find what I'm doing wrong.
Thanks for help.

Alex

plotnikov.av

3 years 1 month ago

In addition, Octet String…

In addition, Octet String works well, but String UTF8 does not.
Is it a bug or my misunderstanding.

Thanks,
Alex

plotnikov.av

3 years 1 month ago

Well. getUtfString(): ... …

Well.

getUtfString():
...
// If there is not enough data available.
if (buff->size - buff->position < (uint16_t)(2 * len))

this condition doesn't work for UTF8 because 2-byte symbol (2*len) is for specific fonts only, numbers and Latin letters are 1-byte symbols.
Anyway, len reflects actual size even for UTF8 and

if (buff->size - buff->position < len)

should work well. Isn't it?

Alex

Profile picture for user Kurumi

Kurumi

3 years 1 month ago

Hi Alex, You are right. This…

Hi Alex,

You are right. This is fixed and tests are on progress. The new version is released today.

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