We are testing IS16444 standard meter. In that, We are able to print the request payload in our log, but in response, we only get 00 01 00 01 00 bytes only in GXByteBuffer.
We want to print the actual payload of responses.
All communications are made in the Wrapper interface only.
You need to read all the data that the meter sends. All the data is not necessarily to come in one TCP/IP frame. Try to read the data again. I believe that there are more bytes coming.
I understood that, But I want to print the payload received on TCP/IP socket.
In the log, I can print just 00 01 00 01 00 rather than the entire response packet. Is there any way to get the complete wrapper frame in GXBytebuffer or any other way.
In HDLC, Able to print the payload but in wrapper not able to print.
Whatever the frame is received from the socket, I just want to print in logs regardless of frame size.
Currently, I am logging data in the following way and it is only printing 00 01 00 01 00 for the wrapper
frame. It should be the actual payload that the meter has sent.
rd = new GXByteBuffer(p.Reply);
logger.Info(rd);
Can you please suggest how I can log that payload?
TCP network packets can come in fragments and I believe this is happening in your case. Your implementation shows only the first fragment from TCP/IP frame. You need to check how many bytes there are in the frame and read them all.
Hi,
Hi,
You need to read all the data that the meter sends. All the data is not necessarily to come in one TCP/IP frame. Try to read the data again. I believe that there are more bytes coming.
BR,
Mikko
Hi Mikko,
Hi Mikko,
I understood that, But I want to print the payload received on TCP/IP socket.
In the log, I can print just 00 01 00 01 00 rather than the entire response packet. Is there any way to get the complete wrapper frame in GXBytebuffer or any other way.
In HDLC, Able to print the payload but in wrapper not able to print.
Hi,
Hi,
Have you tried to use GXDLMSClient.GetFrameSize method? It will tell how many bytes there are on the WRAPPER frame.
BR,
Mikko
Hi Mikko,
Hi Mikko,
It seems that you didn't get my point.
Whatever the frame is received from the socket, I just want to print in logs regardless of frame size.
Currently, I am logging data in the following way and it is only printing 00 01 00 01 00 for the wrapper
frame. It should be the actual payload that the meter has sent.
rd = new GXByteBuffer(p.Reply);
logger.Info(rd);
Can you please suggest how I can log that payload?
Regards
Bhaumik
Hi Bhaumik,
Hi Bhaumik,
TCP network packets can come in fragments and I believe this is happening in your case. Your implementation shows only the first fragment from TCP/IP frame. You need to check how many bytes there are in the frame and read them all.
BR,
Mikko