Hi Mikko Sir,
As gurux windows application seamlessly disconnects and reconnects to the meter everytime by reading its invocation counter, to implement the same in the android component is a bit challenging. As we do not want to save the invocation counter of a particular meter in Android Local Storage, we want the app to read the counter from the meter and make secured connection everytime it is opened. At first the app reads it from the meter and updates inside code, but after closing the connection, removing the app and reopening it, the app is unable to read invocation counter from the meter as the meter seems busy, however, a release request is being sent to it in close() method still, the meter is not released for about 1.5-2 minutes and after waiting for that much time only, we can reopen connection with the meter.
/**
* Close connection to the meter.
*/
public void close() throws Exception {
IGXMedia media = gxDevice.getMedia();
if (media.isOpen()) {
try {
readDLMSPacket2(dlmsClient.releaseRequest());
} catch (Exception e) {
// All meters don't support release. It's OK.
e.printStackTrace();
}
GXReplyData reply = new GXReplyData();
readDLMSPacket(dlmsClient.disconnectRequest(), reply);
media.close();
}
}Not able to find any help regarding this anywhere. Please guide.
Thanks,
Kshitiz
Hi Kshitiz, Some meters can…
Hi Kshitiz,
Some meters can't handle release.
Try to ignore the release if security is not used. It helps with some meters.
if (client.getCiphering.getSecurity() != Security.NONE.getValue())
{
///Release.
}
Hi Mikko Sir, I believe…
Hi Mikko Sir,
I believe that the meters I've been working on support release as there is no connection issue while using gurux windows app on the same meters.
I need to achieve the same in the android app. Please provide any references for studying.
Thanks,
Kshitiz
Dear Kshitiz, This is…
Dear Kshitiz,
This is exactly how the Windows application does it.
BR,
Mikko