23
23
24
24
#ifdef HAS_TCP
25
25
#include < ArduinoIoTCloudTCP.h>
26
- #include " utility/time/TimeService.h"
27
26
#ifdef BOARD_HAS_ECCX08
28
27
#include " tls/BearSSLTrustAnchors.h"
29
28
#include " tls/utility/CryptoUtil.h"
40
39
GLOBAL VARIABLES
41
40
******************************************************************************/
42
41
43
- TimeService time_service;
44
-
45
42
#if OTA_STORAGE_SSU
46
43
static OTAStorage_SSU ota_storage_ssu;
47
44
#elif OTA_STORAGE_SFU
@@ -62,7 +59,7 @@ static const int TIMEOUT_FOR_LASTVALUES_SYNC = 10000;
62
59
63
60
extern " C" unsigned long getTime ()
64
61
{
65
- return time_service. getTime ();
62
+ return ArduinoCloud. getInternalTime ();
66
63
}
67
64
68
65
/* *****************************************************************************
@@ -106,7 +103,7 @@ int ArduinoIoTCloudTCP::begin(ConnectionHandler & connection, String brokerAddre
106
103
_connection = &connection;
107
104
_brokerAddress = brokerAddress;
108
105
_brokerPort = brokerPort;
109
- time_service .begin (&connection);
106
+ _time_service .begin (&connection);
110
107
return begin (_brokerAddress, _brokerPort);
111
108
}
112
109
@@ -223,7 +220,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectPhy()
223
220
224
221
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SyncTime ()
225
222
{
226
- unsigned long const internal_posix_time = time_service .getTime ();
223
+ unsigned long const internal_posix_time = _time_service .getTime ();
227
224
DBG_VERBOSE (" ArduinoIoTCloudTCP::%s internal clock configured to posix timestamp %d" , __FUNCTION__, internal_posix_time);
228
225
return State::ConnectMqttBroker;
229
226
}
0 commit comments