Dear,
With the latest version of gurux.dlms (3.0.6) the GXByteBuffer used for storing the received push messages is not cleared. The code we have is similar to the push receiver example and we didn't observe this behaviour in the older versions (2.X). Is this behaviour expected and we have to manually clear the buffer or are we doing something wrong or is it a bug?
Below is the code we are using:
public void onReceived(Object sender, ReceiveEventArgs e) {
//Some pre-processing
try {
synchronized (this) {
logDebug("Start message processing", true);
reply.set((byte[]) e.getData());
//Create separate clients for each meter due to the encryption
source = sources.get(senderId.toLowerCase());
GXDLMSSecureClient client = getOrCreateClient(source);
//I belive in earlier version(2.x) the buffer was cleared here.
client.getData(reply, source.getData());
if (source.getData().isComplete() && !source.getData().isMoreData()) {
try {
//Perform XML translation and business logic
} finally {
source.clearData();
source.setClient(null);
}
}
}
} catch (Throwable t) {
if (source != null) {
source.clearData();
source.setClient(null);
}
}
}
Attached a screenshot of the debug window with variables.
This is by design. When we are communicating Over The Air the might be several push messages and reply in the same byte stream. That was causing that we can't clear the buffer automatically.
You need to clear the buffer.
Hi,
Hi,
This is by design. When we are communicating Over The Air the might be several push messages and reply in the same byte stream. That was causing that we can't clear the buffer automatically.
You need to clear the buffer.
BR,
Mikko
Thanks Mikko
Thanks Mikko