Hi Mikko!
I would like to call on server side the invoke() method in the class CGXDLMSDisconnectControl, but it is missing.
I think it can be made like this:
typedef int (*pfnMethod)();
CGXDLMSDisconnectControl::setCalbackFunctionMethod1(&pfnMethod);
CGXDLMSDisconnectControl::setCalbackFunctionMethod2(&pfnMethod);
CGXDLMSDisconnectControl::Invoke(CGXDLMSSettings& settings, CGXDLMSValueEventArg& e)
{
if (e.GetIndex() == 1)
{
if(pfnMethod1 != NULL)
pfnMethod1();
}
else if (e.GetIndex() == 2)
{
if(pfnMethod2 != NULL)
pfnMethod2();
}
else
{
e.SetError(DLMS_ERROR_CODE_READ_WRITE_DENIED);
}
return 0;
}
BR,
Dmitry
Hi Dmitry, You must handle…
Hi Dmitry,
You must handle the disconnect control action on PreAction. There is nothing that object can do because disconnect control is accessing the hardware.
BR,
Mikko
Hi! If i handle disconnect…
Hi!
If i handle disconnect control action on Pre Action() gurus return DBMS_ERROR_CODE_READ_WRITE_DENIED from CGXDLMSObject::Invoke().
I inherited my class from CGXDLMSDisconnectControl and redefined the virtual method Invoke(). It's work. But in this case i can't use CGXDLMSObjectFactory::CreateObject() and I created object manually.
Hi, You need to mark action…
Hi,
You need to mark action handled as the server example.
https://github.com/Gurux/Gurux.DLMS.cpp/blob/ab6a23ea5628a84daa822b4282…
BR,
Mikko
Hi! OK, thanks for you reply.
Hi!
OK, thanks for you reply.