I want to know can we resume image transfer after connection failure with dlms for java. I have to sent 2000 block. But after 1000 connection get lost due to ping discontinuity. So i want to connect meter again and image data should be transfer from 10001. Could it be possible?
I can say that it depends on the meter, but usually, it's possible. You can try to read attribute #4 image first not transferred block number and start sending blocks from that. Or you can read attribute #3 and send missing blocks. It's a bit-string that tells what blocks meter has received.
gxReader.readDataBlock(img.imageBlockTransfer(dlms, imgData, imageBlockCount), reply);
Can you tell me how can we pass block number from where i have to initiate?
Above code always try to send block from 1;
Because there might be several missing blocks there is no method for this.
You can do it like this:
List<byte[]> packets = new List<byte[]>();
GXDLMSImageTransfer img = new GXDLMSImageTransfer();
byte[][] blocks = img.GetImageBlocks(image);
//Remove blocks that meter has received.
....
//Generate messages.
foreach (byte[] it in blocks)
{
packets.AddRange(client.Method(img, 2, it, DataType.Array));
}
//Send data.
Hi,
Hi,
I can say that it depends on the meter, but usually, it's possible. You can try to read attribute #4 image first not transferred block number and start sending blocks from that. Or you can read attribute #3 and send missing blocks. It's a bit-string that tells what blocks meter has received.
BR,
Mikko
Step 3: Transfers ImageBlocks
Step 3: Transfers ImageBlocks.
int[] imageBlockCount = new int[1];
imageBlockCount[0] = (int) (imgData.length / img.getImageBlockSize());
gxReader.readDataBlock(img.imageBlockTransfer(dlms, imgData, imageBlockCount), reply);
Can you tell me how can we pass block number from where i have to initiate?
Above code always try to send block from 1;
Thanks... i got it how to do.
Thanks... i got it how to do.
hi
hi
Now i want to know can we set block number in data. Because it always start block number from 0 in image data when resume.
is it needed to call imageTransferInitiate method while resuming.
thanks
Hi,
Hi,
Because there might be several missing blocks there is no method for this.
You can do it like this:
List<byte[]> packets = new List<byte[]>();
GXDLMSImageTransfer img = new GXDLMSImageTransfer();
byte[][] blocks = img.GetImageBlocks(image);
//Remove blocks that meter has received.
....
//Generate messages.
foreach (byte[] it in blocks)
{
packets.AddRange(client.Method(img, 2, it, DataType.Array));
}
//Send data.
BR,
Mikko