Skip to content

Commit

Permalink
Merge pull request #489 from pennam/force-network-time-check
Browse files Browse the repository at this point in the history
If available force network time sync when connecting or reconnecting
  • Loading branch information
pennam authored Jul 23, 2024
2 parents ae0194d + 1e9d38c commit 8dcbf51
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectPhy()

ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SyncTime()
{
if (TimeServiceClass::isTimeValid(getTime()))
/* If available force network time sync when connecting or reconnecting */
if (_time_service.sync())
{
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s internal clock configured to posix timestamp %d", __FUNCTION__, getTime());
return State::ConnectMqttBroker;
Expand Down

0 comments on commit 8dcbf51

Please sign in to comment.