Hello,
I have an APDU byte array, and I'd like to convert it to GXDLMSObject so I can inspect and further work with it. I see that I can use GXDLMSTranslator to translate the byte array to XML, but I want to parse the byte array to a native GXDLMSObject. Is there any way to do that?
Many thanks
Plamen
So what I have is the…
So what I have is the following:
I have a hex string coming from an Hexing DCU grid meter reading upload.
The hex string is something like this:
0001010204090C07E902190200000000FF8800110006000000050600000032
which the Gurux PDU XML translator translates to:
<Data="01010204090C07E902190200000000FF8800110006000000050600000032" />
If I add C401C6 at the beginning to it - I am able to parse it as a response:
C401C60001010204090C07E902190200000000FF8800110006000000050600000032
<GetResponse>
<GetResponseNormal>
<!--Priority: HIGH ServiceClass: CONFIRMED invokeID: 6-->
<InvokeIdAndPriority Value="C6" />
<Result>
<Data>
<Array Qty="01" >
<Structure Qty="04" >
<!--2025-02-25 00:00:00-->
<OctetString Value="07E902190200000000FF8800" />
<UInt8 Value="00" />
<UInt32 Value="00000005" />
<UInt32 Value="00000032" />
</Structure>
</Array>
</Data>
</Result>
</GetResponseNormal>
</GetResponse>
-- Is there any way programatically to parse the byte array to a Gurux object so I can work with it. I don't want to have to parse the result XML if possible.
Thanks again
Plamen
Nevermind, I figured it out…
Nevermind, I figured it out. I removed the first byte and then used GXDLMSClient.getValue() and it returned a GXArray.
Hi Plamen, I don't know why…
Hi Plamen,
I don't know why there is that one extra byte, but you are right. The data is there after you remove the first byte.
Mikko