Closed
Description
I have a class which uses MQTTClient
. I want to pass a pointer to class method as a callback to onMessage
. Could you please create an overloaded onMessage
method which would accept a "context" (a pointer to a class instance) and a callback (a pointer to a method of this class)?
Otherwise it is almost impossible for me to have a callback which would have an access to the rest of my class instance methods.
class App
{
//...skipped
public:
void messageHandler(String &topic, String &payload);
void setup();
MQTTClient client;
}
//---
void App::setup()
{
//...skipped
client.onMessage(this, App::onMessage);
}
Metadata
Metadata
Assignees
Labels
No labels