Would it be possible to put a callback function into the MQTT_Publish function so that we can get a confirmation the message has been sent.
The reason for asking this, is that I intend to sleep the ESP8266 after sending a message, however there seems to be no easy way with the task system of knowing when a message has been sent. I did try setting a volatile variable once a message was sent, but a tight while loop "while(var == 0);" causes the task system to lock up. A callback would solve this issue.
Alternatively, is there an equiverlent of the DoEvents() type call, which will allow the task system to keep working, whilst I'm waiting for the variable to be set?
Cheers
Glen.