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. Node
  3. 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 7 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 7 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 7 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 7 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, 10/13/2026 - 12:00
    gurux.dlms.java 4.0.97
  • Tue, 09/22/2026 - 14:02
    Gurux.DLMS.Net 9.0.2609.2201
  • Mon, 09/21/2026 - 10:18
    Gurux.DLMS.Net 9.0.2609.2101
  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202

New forum topics

  • Need RJ45 pin configuration for Saral 300 and Saral 305 Secure meters
  • Query Regarding Class 63 Status Mapping Support in Gurux DLMS Python
  • Inhemeter
  • DLMS Server - Profile Generic - can't add too many items to profile generic capture object - how to set maximum profile entries
  • HDLC Frames sequencing
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin