Fixed bug where callbacks were not getting called if the CMD MQTT client called connect while the ESP MQTT client was connected or disconnected.

pull/72/head
Benjamin Runnels 9 years ago
parent a0451b2b7b
commit 25ef0e1578
  1. 8
      mqtt/mqtt_cmd.c

@ -314,6 +314,14 @@ MQTTCMD_Connect(CmdPacket *cmd) {
CMD_Request(&req, cmd);
#ifdef MQTT_1_CLIENT
if (mqttClient.connState == MQTT_CONNECTED && mqttClient.cmdConnectedCb) {
mqttClient.cmdConnectedCb((uint32_t*)&mqttClient);
}
else if (mqttClient.connState == MQTT_DISCONNECTED && mqttClient.cmdDisconnectedCb) {
mqttClient.cmdDisconnectedCb((uint32_t*)&mqttClient);
}
return 1;
#else

Loading…
Cancel
Save