How can I write attribute 3 of generic profile using GuruxDLMS.c. Is there an example? I only found reading examples.
I used com_write, but with a sufficiently large number of objects, when the package is divided into several blocks, I get an error. If the data is placed in one block, then the recording completes successfully. It looks like there are problems with block transfer.
Forums
Thus GXDLMSDirector writes…
Thus GXDLMSDirector writes correctly. GuruxDLMS.c adds an attributeDescriptor to each block, while GXDLMSDirector only adds this data in the first block
Green Book: "The COSEM_Attribute_Descriptor parameter references a COSEM object attribute. It is present when Request_Type == NORMAL, FIRST-BLOCK, WITH-LIST and FIRST-BLOCK-WITH-LIST"
GuruxDLMS.c adds attributeDescriptor for LAST-BLOCK
Hi, Is your meter using…
Hi,
Is your meter using General Block Transfer?
Let me know this. I'll check this and let you know what happens after you have shared this information with me.
BR,
Mikko
Good day, Yes the meter uses…
Good day,
Yes the meter uses General Block Transfer.
I added "if" in two functions. After that, the writing is successful. But I'm not 100% sure that my fix is correct
1. dlms_multipleBlocks:
void dlms_multipleBlocks(gxLNParameters *p, gxByteBuffer *reply, unsigned char ciphering)
{
// Check is all data fit to one message if data is given.
int len = bb_available(p->data);
if (p->attributeDescriptor != NULL)
{
if (!(p->command == DLMS_COMMAND_SET_REQUEST && p->requestType == DLMS_SET_COMMAND_TYPE_WITH_DATABLOCK))
{
len += p->attributeDescriptor->size;
}
}
2. dlms_getLNPdu
// Add attribute descriptor.
#ifndef DLMS_IGNORE_MALLOC
// Add attribute descriptor.
if (ret == 0 && p->attributeDescriptor != NULL)
{
if (!(p->command == DLMS_COMMAND_SET_REQUEST && p->requestType == DLMS_SET_COMMAND_TYPE_WITH_DATABLOCK))
{
ret = bb_set(reply, p->attributeDescriptor->data, p->attributeDescriptor->size);
}
}
#endif //DLMS_IGNORE_MALLOC