I want execute the action of GXDLMSRegister (reset) but simulator always returns the error "DataAccessResultReadWriteDenied"
This is the code:
var testAction = new GXDLMSRegister("1.0.1.7.0.255");
testAction.SetAccess(2, AccessMode.ReadWrite);
testAction.SetMethodAccess(0, MethodAccessMode.Access);
testAction.SetMethodAccess(1, MethodAccessMode.Access); // I suppose only this one is necessary
testAction.SetMethodAccess(2, MethodAccessMode.Access);
currentServer.Items.Add(testAction);
Why is not working? Could you provide me an example?
Because access levels might depend on several options, ex. authentication level Access and MethodAccess are handled in server side. You need to make business logic to GetAttributeAccess and GetMethodAccess methods.
Your server is implementing those, but I believe that you are returning no access.
We use the Gurux Server (GXDLMSServer), HandleRequest function.
This is the server configuration:
var testAction = new GXDLMSRegister("1.0.1.7.0.255");
testAction.SetAccess(2, AccessMode.ReadWrite);
testAction.SetMethodAccess(0, MethodAccessMode.Access);
testAction.SetMethodAccess(1, MethodAccessMode.Access); // I suppose only this one is necessary
testAction.SetMethodAccess(2, MethodAccessMode.Access);
currentServer.Items.Add(testAction);
Hi,
Hi,
Because access levels might depend on several options, ex. authentication level Access and MethodAccess are handled in server side. You need to make business logic to GetAttributeAccess and GetMethodAccess methods.
Your server is implementing those, but I believe that you are returning no access.
BR,
Mikko
Hi,
Hi,
We use the Gurux Server (GXDLMSServer), HandleRequest function.
This is the server configuration:
var testAction = new GXDLMSRegister("1.0.1.7.0.255");
testAction.SetAccess(2, AccessMode.ReadWrite);
testAction.SetMethodAccess(0, MethodAccessMode.Access);
testAction.SetMethodAccess(1, MethodAccessMode.Access); // I suppose only this one is necessary
testAction.SetMethodAccess(2, MethodAccessMode.Access);
currentServer.Items.Add(testAction);
This is the log trace:
2020-04-29 15:08:03 DBG [SIM] Client Connected at: 127.0.0.1:59123 to Server on: 4063
2020-04-29 15:08:03 DBG [SIM] From:127.0.0.1:59123 -> To:4063 => 00 01 00 01 00 01 00 40 60 3E A1 09 06 07 60 85 74 05 08 01 01 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 12 80 10 AE 8E C3 31 D0 FB F3 B8 F1 74 FE A2 C1 9A 26 41 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 18 1F 23 28
2020-04-29 15:08:03 INF Sending...
2020-04-29 15:08:03 DBG [SIM] Sent From:4063 -> To:127.0.0.1:59123 => 00 01 00 01 00 01 00 2B 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 18 1D 23 28 00 07
2020-04-29 15:08:03 DBG [SIM] From:127.0.0.1:59123 -> To:4063 => 00 01 00 01 00 01 00 0F C3 01 41 00 03 01 00 01 07 00 FF 01 01 0F 00
2020-04-29 15:08:03 INF Sending...
2020-04-29 15:08:03 DBG [SIM] Sent From:4063 -> To:127.0.0.1:59123 => 00 01 00 01 00 01 00 04 C7 01 41 03
2020-04-29 15:08:03 DBG [SIM] From:127.0.0.1:59123 -> To:4063 => 00 01 00 01 00 01 00 05 62 03 80 01 00
2020-04-29 15:08:03 INF Sending...
2020-04-29 15:08:04 DBG [SIM] Sent From:4063 -> To:127.0.0.1:59123 => 00 01 00 01 00 01 00 05 63 03 80 01 00
2020-04-29 15:08:05 DBG [SIM] Client at: Disconnected from: 4063
Why is not working? Could you provide me an example?
Thanks.
Hi,
Hi,
Open your Gurux server and find GetMethodAccess method. Add your logic there.
You can simply return MethodAccessMode.Access there.
BR,
Mikko