Skip to content

Commit 1e9d38c

Browse files
committed
If available force network time sync when connecting or reconnecting
1 parent 8b6ff40 commit 1e9d38c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/ArduinoIoTCloudTCP.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectPhy()
267267

268268
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SyncTime()
269269
{
270-
if (TimeServiceClass::isTimeValid(getTime()))
270+
/* If available force network time sync when connecting or reconnecting */
271+
if (_time_service.sync())
271272
{
272273
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s internal clock configured to posix timestamp %d", __FUNCTION__, getTime());
273274
return State::ConnectMqttBroker;

0 commit comments

Comments
 (0)