GXDLMSNotifyHandler notify = new GXDLMSNotifyHandler(
//Is Logical name referencing used.
true,
//Client address
16,
//Server address.
1,
// Is used HDLC or COSEM transport layers for IPv4 networks (IEC 62056-47)
InterfaceType.Wrapper);
GXReplyData info = new GXReplyData();
notify.getData(data, info);
if (info.getMoreData() == RequestTypes.NONE)
{
List<SimpleEntry<GXDLMSObject, Integer>> objects = notify.parsePushObjects(info.getData());
}
Here i am facing following problems.
1. Gurux library does not have GXDLMSNotifyHandler class. It has GXDLMSNotify. GXDLMSNotify has parsePush(Object[]) method.
2. notify.getData(data, info); in this what does data argument belong to. I am unable to get data.
3. GXReplyData does not have getData() that returns array of Objects. So i can not pass info.getData() argument in parsePush() of GXDLMSNotify.
You should check Gurux.DLMS.Push.Listener.Example. That will do the work for you.
There is one thing that I need to warn about. Meters can be configured in different ways.
When this was implemented we were reading meters where the first object was push_object_list of the Push object. That describes the content of the Push message. There are a lot of meters that are not sending push_object_list in push msg. Yes, I know that there are a lot of extra bytes to send, but it describes the content of the data. If that is not sent, we don't know what kind of data we are receiving. Because push_object_list is not always sent you need to know what kind of data you are receiving. This causes some extra work for you.
You can use GXDLMSClient to receive Push messages.
GXDLMSClient cl = new GXDLMSClient(true, 1, 1, Authentication.None, null, InterfaceType.WRAPPER);
GXReplyData info = new GXReplyData();
notify.getData(data, info);
if (info.getMoreData() == RequestTypes.NONE)
{
info.Time; //When Push msg was sent.
info.Value; //Received data. Handle this as meter is confiqured.
}
Recieving Push Message
Hi,
You should check Gurux.DLMS.Push.Listener.Example. That will do the work for you.
There is one thing that I need to warn about. Meters can be configured in different ways.
When this was implemented we were reading meters where the first object was push_object_list of the Push object. That describes the content of the Push message. There are a lot of meters that are not sending push_object_list in push msg. Yes, I know that there are a lot of extra bytes to send, but it describes the content of the data. If that is not sent, we don't know what kind of data we are receiving. Because push_object_list is not always sent you need to know what kind of data you are receiving. This causes some extra work for you.
You can use GXDLMSClient to receive Push messages.
GXDLMSClient cl = new GXDLMSClient(true, 1, 1, Authentication.None, null, InterfaceType.WRAPPER);
GXReplyData info = new GXReplyData();
notify.getData(data, info);
if (info.getMoreData() == RequestTypes.NONE)
{
info.Time; //When Push msg was sent.
info.Value; //Received data. Handle this as meter is confiqured.
}
BR,
Mikko