Skip to content

How I can call funtions callback into a Class  #4

Description

@GiovaniSchreiber

I am trying to call the function "callback" into a Class, but it not work.

PubSubClientTools *clientMQTT;

......
clientMQTT->subscribe(TOPICO_SUBSCRIBE_CM_LAMP, MQTTClass::subscriber);//the problem is here
//clientMQTT->subscribe(TOPICO_SUBSCRIBE_CM_LAMP, std::bind(&MQTTClass::subscriber, this);//not work too
..........
void MQTTClass::subscriber(String topic, String message) {
MQTT_Call_buttonPress(bool(message), MQTT_S);
}
Does anyone know how I do 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