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 3 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 3 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 3 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 3 months ago

Hi! OK, thanks for you reply.

Hi!

OK, thanks for you reply.

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin