Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. How To Call CGXDLMSDisconnectControl::Invoke() Method?

How to call CGXDLMSDisconnectControl::Invoke() method?

Profile picture for user Dmitry
By Dmitry , 31 March, 2025
Forums
Gurux.DLMS

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

Profile picture for user Kurumi

Kurumi

1 year 2 months ago

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

Profile picture for user Dmitry

Dmitry

1 year 2 months ago

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.

Profile picture for user Kurumi

Kurumi

1 year 2 months ago

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

Profile picture for user Dmitry

Dmitry

1 year 2 months ago

Hi! OK, thanks for you reply.

Hi!

OK, thanks for you reply.

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin