Gurux.DLMS.Client.Example.Net_2010

Hi,
I am new with Gurux projects and I have very little experience with C# too,
but I have found a bug using Gurux.DLMS.Client.Example.Net_2010 project together with Gurux.DLMS.Server.Example_2010.

The bug manifests itself using TCP/IP connection with LN:

Initializing Network connection.
Disconnecting from the meter.
-> 9.22.34 00-01-00-01-00-10-00-02-63-00
Il valore non può essere null.
Nome parametro: value

debugging the code I found the problem is located into the GXCommunication.cs source module at line 273 when "Trace" is enabled and "data" is NULL:

...
foreach (byte[] it in Client.AARQRequest(null))
{
if (Trace)
{
if (data == null)
{
data = NODATA;
}
Console.WriteLine("Send AARQ request", BitConverter.ToString(data));
...

so I suggest one of the possible solutions of the source code as follow:

...
byte[] NODATA = {};
...
foreach (byte[] it in Client.AARQRequest(null))
{
if (Trace)
{
if (data == null)
{
data = NODATA;
}
Console.WriteLine("Send AARQ request", BitConverter.ToString(data));
}
reply = ReadDLMSPacket(it);
}
if (Trace)
{
if (reply == null)
{
reply = NODATA;
}
Console.WriteLine("Parsing AARE reply" + BitConverter.ToString(reply));
}
...

Best regard

Franco

Kurumi's picture

Hi,

Thanks for let us know. You was right.
We changed

Console.WriteLine("Send AARQ request", BitConverter.ToString(data));

to
Console.WriteLine("Send AARQ request", BitConverter.ToString(it));

and fixed this.

We version is in Gurux SVN and Github.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi