2323
2424#ifdef HAS_TCP
2525#include < ArduinoIoTCloudTCP.h>
26- #include " utility/time/TimeService.h"
2726#ifdef BOARD_HAS_ECCX08
2827 #include " tls/BearSSLTrustAnchors.h"
2928 #include " tls/utility/CryptoUtil.h"
4039 GLOBAL VARIABLES
4140 ******************************************************************************/
4241
43- TimeService time_service;
44-
4542#if OTA_STORAGE_SSU
4643 static OTAStorage_SSU ota_storage_ssu;
4744#elif OTA_STORAGE_SFU
@@ -62,7 +59,7 @@ static const int TIMEOUT_FOR_LASTVALUES_SYNC = 10000;
6259
6360extern " C" unsigned long getTime ()
6461{
65- return time_service. getTime ();
62+ return ArduinoCloud. getInternalTime ();
6663}
6764
6865/* *****************************************************************************
@@ -106,7 +103,7 @@ int ArduinoIoTCloudTCP::begin(ConnectionHandler & connection, String brokerAddre
106103 _connection = &connection;
107104 _brokerAddress = brokerAddress;
108105 _brokerPort = brokerPort;
109- time_service .begin (&connection);
106+ _time_service .begin (&connection);
110107 return begin (_brokerAddress, _brokerPort);
111108}
112109
@@ -223,7 +220,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectPhy()
223220
224221ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SyncTime ()
225222{
226- unsigned long const internal_posix_time = time_service .getTime ();
223+ unsigned long const internal_posix_time = _time_service .getTime ();
227224 DBG_VERBOSE (" ArduinoIoTCloudTCP::%s internal clock configured to posix timestamp %d" , __FUNCTION__, internal_posix_time);
228225 return State::ConnectMqttBroker;
229226}
0 commit comments