Browse Source

* make mClient in mqtt private again (#145)

* v0.5.10
pull/152/head
lumapu 3 years ago
parent
commit
e1c713fb00
  1. 2
      tools/esp8266/app.cpp
  2. 2
      tools/esp8266/defines.h
  3. 7
      tools/esp8266/mqtt.h

2
tools/esp8266/app.cpp

@ -163,7 +163,7 @@ void app::setup(uint32_t timeout) {
mqttPort = 1883;
mMqtt.setup(mqttAddr, mqttTopic, mqttUser, mqttPwd, mqttDevName, mqttPort);
mMqtt.mClient->setCallback(std::bind(&app::cbMqtt, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
mMqtt.setCallback(std::bind(&app::cbMqtt, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
mMqttTicker = 0;
#ifdef __MQTT_TEST__

2
tools/esp8266/defines.h

@ -21,7 +21,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 5
#define VERSION_PATCH 9
#define VERSION_PATCH 10
//-------------------------------------

7
tools/esp8266/mqtt.h

@ -12,8 +12,6 @@
class mqtt {
public:
PubSubClient *mClient;
mqtt() {
mClient = new PubSubClient(mEspClient);
mAddressSet = false;
@ -42,8 +40,8 @@ class mqtt {
mClient->setBufferSize(MQTT_MAX_PACKET_SIZE);
}
void setCallback(void (*func)(const char* topic, byte* payload, unsigned int length)){
mClient->setCallback(func);
void setCallback(MQTT_CALLBACK_SIGNATURE){
mClient->setCallback(callback);
}
void sendMsg(const char *topic, const char *msg) {
@ -131,6 +129,7 @@ class mqtt {
}
WiFiClient mEspClient;
PubSubClient *mClient;
bool mAddressSet;
uint16_t mPort;

Loading…
Cancel
Save