我正在使用 ESP32。目前我正在从 ESP8266 代码库迁移我的库。
我目前正在执行以下操作:
m_pubSubClient.setCallback( std::bind(&CL::callbackHandler, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
但似乎 PubSubClient 库的作者更改了签名。
// old
#define MQTT_CALLBACK_SIGNATURE std::function<void(char*, uint8_t*, unsigned int)> callback
//new
#define MQTT_CALLBACK_SIGNATURE void (*callback)(char*, uint8_t*, unsigned int)
我不知道如何使用新签名来做到这一点。