Gurux.DLMS.XmlClient settings of invocation counter

2 posts / 0 new
Last post
Gurux.DLMS.XmlClient settings of invocation counter

Hi Mikko,

I am working with the Gurux.DLMS.XmlClient console project programmed in C #, I am trying to configure it as HLS GMAC AuthenticationEncryption.

Until now I have added the following lines of code to the Gurux.DLMS.XmlClient project to the Programs.cs file, to configure them through the windows console:

settings.client.Ciphering.BlockCipherKey = ASCIIEncoding.ASCII.GetBytes(it.Value);
settings.client.Ciphering.AuthenticationKey = ASCIIEncoding.ASCII.GetBytes(it.Value);
settings.client.Ciphering.DedicatedKey = ASCIIEncoding.ASCII.GetBytes(it.Value);
settings.client.Ciphering.InvocationCounter = uint.Parse(it.Value);
settings.client.Ciphering.Security = (Security)Enum.Parse(typeof(Security), it.Value);
settings.client.Ciphering.SecuritySuite = (Objects.Enums.SecuritySuite)Enum.Parse(typeof(Objects.Enums.SecuritySuite), it.Value);
settings.client.Ciphering.SystemTitle = ASCIIEncoding.ASCII.GetBytes(it.Value);

With these configurations the first data of the AARQ are sent well with the exception of the invocation counter which sends the bytes 0x43 0x44 0x45 0x46 instead of 0x00 0x00 0x00 0x01, which is how the GXDLMSDirector does.

To configure the InvocationCounter, I send from the console: -I 0

but still the invocation counter has a very large value instead of 0.

Could you help me to know what is missing in my configurations or if I am not configuring the client invocation counter well?

Rafael Sánchez

Kurumi's picture


XML Client example is now improved. You can give those values as command line parameters. Something like:
-x test.xml -t Verbose -C AuthenticationEncryption -F 100 -T System_title -A Authentication_key -B Block_cipher_key -D Dedicated_key

Get the latest version from GitHub.



Mikko Kurunsaari
Gurux Ltd