Skip to content

Commit 256618c

Browse files
committed
ArduinoIoTCloudTCP: use getWaitTime() for broker connection retry
1 parent 98ed820 commit 256618c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/ArduinoIoTCloudTCP.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,10 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
344344
}
345345

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

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

0 commit comments

Comments
 (0)