Added a MqttGuard Class and corresponding interface to Basecamp so anyone can check if all mqtt-packets have been sent easily before going to put the esp to deep sleep.
Does not break with old projects.
For documentation, see added example and mqttGuardInterface.hpp
Old projects can be easily upgraded by doing the following modifications:
change every Basecamp::mqtt.onPublish to Basecamp::mqttOnPublish
change every Basecamp::mqtt.onDisconnect to Basecamp::mqttOnDisconnect
change every Basecamp::mqtt.publish to Basecamp::mqttPublish
check Basecamp::mqttAllSent() to see if its safe to sleep.
Added a MqttGuard Class and corresponding interface to Basecamp so anyone can check if all mqtt-packets have been sent easily before going to put the esp to deep sleep.
Does not break with old projects. For documentation, see added example and mqttGuardInterface.hpp
Old projects can be easily upgraded by doing the following modifications: