Simulated time for unit test

This change needs some modification in EpoxyDuino that are not yet accepted.
This commit is contained in:
hsaturn
2022-12-29 00:54:15 +01:00
parent f348d82167
commit f0af2b95e3
5 changed files with 60 additions and 11 deletions

View File

@@ -88,9 +88,9 @@ void MqttClient::close(bool bSendDisconnect)
void MqttClient::connect(MqttBroker* local)
{
debug("MqttClient::connect_local");
alive = 0;
close();
local_broker = local;
clientAlive();
}
void MqttClient::connect(std::string broker, uint16_t port, uint16_t ka)
@@ -271,7 +271,7 @@ void MqttClient::clientAlive()
debug("MqttClient::clientAlive");
if (keep_alive)
{
alive=millis()+1000*(keep_alive+local_broker ? 5 : 0);
alive=millis()+1000*(keep_alive+(local_broker ? TINY_MQTT_CLIENT_ALIVE_TOLERANCE : 0));
}
else
alive=0;