Skip to content

Commit 8dcbf51

Browse files
authored
Merge pull request #489 from pennam/force-network-time-check
If available force network time sync when connecting or reconnecting
2 parents ae0194d + 1e9d38c commit 8dcbf51

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
@@ -263,7 +263,8 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectPhy()
263263

264264
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SyncTime()
265265
{
266-
if (TimeServiceClass::isTimeValid(getTime()))
266+
/* If available force network time sync when connecting or reconnecting */
267+
if (_time_service.sync())
267268
{
268269
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s internal clock configured to posix timestamp %d", __FUNCTION__, getTime());
269270
return State::ConnectMqttBroker;

0 commit comments

Comments
 (0)