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
In addition, Octet String…
In addition, Octet String works well, but String UTF8 does not.
Is it a bug or my misunderstanding.
Thanks,
Alex
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
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