multipleBlocks() in GXDLMS.py
Current code:
len_ += p.attributeDescriptor.size
Should be:
len_ += p.attributeDescriptor.available()
Reason:
For the second and following PDU blocks, attributeDescriptor has already been consumed in the first block.
At this point the buffer position is already at the end, so:
p.attributeDescriptor.available()
returns 0.
However:
p.attributeDescriptor.size
returns the full buffer size (9 bytes in this case), which incorrectly increases the calculated PDU length.
Because of this, for some boundary data sizes multipleBlocks() calculates an incorrect PDU size and the final block is generated with:
LastBlock = 0
instead of:
LastBlock = 1
This causes the receiver to wait for another block even though all data has already been transferred.