Add mqttEverySecond

This commit is contained in:
fvanroie 2024-05-24 22:18:57 +02:00
parent b118e56245
commit 944f92e588
2 changed files with 8 additions and 2 deletions

View File

@ -438,6 +438,9 @@ void mqttSetup()
IRAM_ATTR void mqttLoop() {}; IRAM_ATTR void mqttLoop() {};
void mqttEverySecond()
{}
void mqttEvery5Seconds(bool wifiIsConnected) void mqttEvery5Seconds(bool wifiIsConnected)
{ {
if(!mqttIsConnected() && !mqttConnecting && mqttServer.length() > 0 && mqttPort > 0) { if(!mqttIsConnected() && !mqttConnecting && mqttServer.length() > 0 && mqttPort > 0) {

View File

@ -391,6 +391,9 @@ IRAM_ATTR void mqttLoop()
if(rc == MQTTCLIENT_SUCCESS && message) mqtt_message_arrived(mqtt_client, topicName, topicLen, message); if(rc == MQTTCLIENT_SUCCESS && message) mqtt_message_arrived(mqtt_client, topicName, topicLen, message);
}; };
void mqttEverySecond()
{}
void mqttEvery5Seconds(bool wifiIsConnected) void mqttEvery5Seconds(bool wifiIsConnected)
{ {
if(!mqttIsConnected()) { if(!mqttIsConnected()) {