Arduino_SNMP icon indicating copy to clipboard operation
Arduino_SNMP copied to clipboard

addDynamicIntegerHandler usage

Open GiovanniMasuri14 opened this issue 10 months ago • 0 comments

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?

GiovanniMasuri14 avatar Mar 27 '24 18:03 GiovanniMasuri14