Skip to content

Commit

Permalink
fix: infinite disconnect loop
Browse files Browse the repository at this point in the history
  • Loading branch information
zfields committed Jul 2, 2024
1 parent 8b6ff40 commit e1b955b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,14 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Disconnect()
_mqttClient.stop();
}

// Reset the Thing property container
Message message = { ResetCmdId };
_thing.handleMessage(&message);
_thing.update();

// Reset the Device property container
_device.handleMessage(&message);
_device.update();

DEBUG_INFO("Disconnected from Arduino IoT Cloud");
execCloudEventCallback(ArduinoIoTCloudEvent::DISCONNECT);
Expand Down

0 comments on commit e1b955b

Please # to comment.