You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
dersimn commentedon Feb 26, 2020
This library already does it in the .h file, just implement something similar in your own code:
ArduinoPubSubClientTools/PubSubClientTools.h
Line 41 in bd93920
Afaik the std::* things are only available on ESP8266, not AVR platform.
GiovaniSchreiber commentedon Feb 28, 2020
thanks