MQTT icon indicating copy to clipboard operation
MQTT copied to clipboard

Make the publish function blocking

Open shivams opened this issue 6 years ago • 1 comments

I put my device to sleep after publishing. However, I have to provide a delay of a few seconds before that, so that publishing is done. Is there any way to know the status of publishing before going to sleep? Alternatively, is there some flag to make the publish function blocking, so that the code doesn't proceed ahead without the publishing been done.

shivams avatar Jul 14 '18 10:07 shivams

publish function is synchronize method. If publish function done, your data already send to mqtt server. otherwise, you cloud use the QoS =1|2 callback function(mqttqostest.ino) for your checking data.

hirotakaster avatar Jul 19 '18 09:07 hirotakaster