Avoid further wait period after reconnect timeout occurs

When reconnect timer expires an additional waiting period of half the
timeout period is seen. Skip this extra waiting period when timeout
is detected and perform the connect attempt right away. This change
makes configured reconnect timeout value MQTT_RECONNECT_TIMEOUT_MS
accurate.
This commit is contained in:
Mikael Kanstrup
2018-10-25 09:50:01 +02:00
parent f9abda0ddd
commit 17fd713bce

View File

@ -845,6 +845,7 @@ static void esp_mqtt_task(void *pv)
client->state = MQTT_STATE_INIT;
client->reconnect_tick = platform_tick_get_ms();
ESP_LOGD(TAG, "Reconnecting...");
break;
}
vTaskDelay(client->wait_timeout_ms / 2 / portTICK_RATE_MS);
break;