Skip to content

Commit

Permalink
ArduinoIoTCloudTCP: use getWaitTime() for broker connection retry
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Apr 15, 2024
1 parent 98ed820 commit 256618c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,10 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
}

/* Can't connect to the broker. Wait: 2s -> 4s -> 8s -> 16s -> 32s -> 32s ... */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
unsigned long const reconnection_retry_delay = _connection_attempt.retry();
#pragma GCC diagnostic pop
_connection_attempt.retry();

DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not connect to %s:%d", __FUNCTION__, _brokerAddress.c_str(), _brokerPort);
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s %d next connection attempt in %d ms", __FUNCTION__, _connection_attempt.getRetryCount(), reconnection_retry_delay);
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s %d next connection attempt in %d ms", __FUNCTION__, _connection_attempt.getRetryCount(), _connection_attempt.getWaitTime());
/* Go back to ConnectPhy and retry to get time from network (invalid time for SSL handshake?)*/
return State::ConnectPhy;
}
Expand Down

0 comments on commit 256618c

Please sign in to comment.