we are doing the re connection of the meter is getting the following error.
"Connection is permanently rejected No reason is given"
Scenarios :
1. Once open the App and do the connection is successful
2.After kill and relaunch the App and do the connection is getting the Above Error.
Please help how can resolve this error.
Hi, You have not properly…
Hi,
You have not properly closed the existing connection. You need to wait until inactivity timeout occurs or close the connection when you close the application.
I propose that you close the connection to prevent this error.
BR,
Mikko
The following code will do…
The following code will do connect/close process. Please check and correct me if it is wrong. Thanks...
if (media != null) {
if (media.isOpen) {
// Close connection
close()
} else {
//Open connection.
initializeConnection()
}
}
@Throws(java.lang.Exception::class)
private fun close() {
val media = mDevice!!.media
if (media.isOpen) {
/ try {
readDLMSPacket2(mClient!!.releaseRequest())
} catch (e: java.lang.Exception) {
//All meters don't support release. It's OK.
}
val reply = GXReplyData()
readDLMSPacket(mClient!!.disconnectRequest(), reply)
/ media.close()
}
}
Hi, Some meters expect that…
Hi,
Some meters expect that you must wait for a while before a new connection.
It's hard to say what might be the issue because I don't have your meter. Try to connect with GXDSLMDirector multiple times and if it the connection fails, you need just wait for a while before the new connection.
BR,
Mikko