We are not getting any values out of the reply when using get with list and if the response is more than one data block. We have the below code to read with list:
01private void readList(List<Entry<GXDLMSObject, Integer>> list) throws Exception {
02 if (list.size() != 0) {
03 // uses Command.GET_REQUEST with GetCommandType.WITH_LIST
04 byte[][] data = client.readList(list);
05 GXReplyData reply = new GXReplyData();
06 List<Object> values = new ArrayList<Object>(list.size());
07 for (byte[] it : data) {
08 readDataBlock(it, reply);
09 if (list.size() != 1 && reply.getValue() instanceof Object[]) {
10 values.addAll(Arrays.asList((Object[]) reply.getValue()));
11 } else if (reply.getValue() != null) {
12 // Value is null if data is send multiple frames.
13 Object value = reply.getValue();
14 values.add(value);
15 }
16 reply.clear();
17 }
18 if (values.size() != list.size()) {
19 throw new Exception("Invalid reply. Read items count do not match.");
20 }
21 client.updateValues(list, values);
22 }
23 }
When I use the reply.getValue()(line no 13) the value is something random sometimes boolean, sometimes GXBitString etc. But in the debugger, if I check the contents of the reply(reply.data) then it shows the correct data in hex format but fails while retrieving the values(reply.dataValue).
This works fine if the response is only in a single block. Could you please do let us what might be the issue.
Also the latest Gurux.dlms version 2.2.24 is not published into the maven central repository. Could you please do publish it.
Dear Mikko
Could you please do let me know if this was fixed in release 2.2.25 or if it will be fixed in some later release. I have tested the code with 2.2.25 and the issue is still present. I went through the changes and I couldn't understand if this was fixed and I have to do some code changes or this will be fixed in some future releases.
If fixed in 2.2.25 could you please do let me know if I have to call a different method instead of
Object value = reply.getValue();
values.add(value);
Thank You
BR,
Pramod
Hi,
Hi,
Can you send a log to me by email? We'll check this.
BR,
Mikko
Thanks Mikko, I have sent the
Thanks Mikko, I have sent the log by email.
Dear Miko
Dear Mikko
Could you please do let me know if this was fixed in release 2.2.25 or if it will be fixed in some later release. I have tested the code with 2.2.25 and the issue is still present. I went through the changes and I couldn't understand if this was fixed and I have to do some code changes or this will be fixed in some future releases.
If fixed in 2.2.25 could you please do let me know if I have to call a different method instead of
Object value = reply.getValue();
values.add(value);
Thank You
BR,
Pramod
Dear Pramod,
Dear Pramod,
This is fixed this and we are now testing it. We'll release next version on next week where this is fixed.
BR,
Mikko
Thanks for the Mikko
Thanks for the Mikko
Dear Pramod,
Dear Pramod,
New version 2.2.26 is released where this is fixed.
BR,
Mikko
Dear Mikko, Thank you for the
Dear Mikko, Thank you for the update. This works now