Skip to content

Commit

Permalink
* make mClient in mqtt private again (lumapu#145)
Browse files Browse the repository at this point in the history
* v0.5.10
  • Loading branch information
lumapu committed Aug 12, 2022
1 parent 0ff4368 commit e1c713f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tools/esp8266/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
2 changes: 1 addition & 1 deletion tools/esp8266/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 5
#define VERSION_PATCH 9
#define VERSION_PATCH 10


//-------------------------------------
Expand Down
7 changes: 3 additions & 4 deletions tools/esp8266/mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

class mqtt {
public:
PubSubClient *mClient;

mqtt() {
mClient = new PubSubClient(mEspClient);
mAddressSet = false;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -131,6 +129,7 @@ class mqtt {
}

WiFiClient mEspClient;
PubSubClient *mClient;

bool mAddressSet;
uint16_t mPort;
Expand Down

0 comments on commit e1c713f

Please sign in to comment.