Skip to content

addDynamicIntegerHandler usage #47

Description

@GiovanniMasuri14

I need to provide a read-only changing integer so i think i need to use the addDynamicIntegerHandler.
The challenge for me is that the SNMPAgent instance is a class member and i dont know what i've to pass as GETINT_FUNC.

class MyClass
{
	private:
		int myChangingInt;
		SNMPAgent * snmp;
		int callback_test() {return myChangingInt};
		void Init()
		{
			snmp = new SNMPAgent("public", "private");
			.
			.
			.
			// the following line returns an invalid use of non-static member function 'int MyClass::callback_test()'
    			snmp->addDynamicIntegerHandler(".1.3.6.1.4.1.14.1", callback_test, true);
			.
			.
			.
		};
};

Anyone that knows how to solve it?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions