Skip to content

Commit edbca65

Browse files
authored
Register a callback function with ArduinoCloudThing (#93)
This allows class ArduinoCloudThing to obtain a 'epoch' timestamp which is used during synchronisation and which has been implemented so far via an 'extern' dependency to RTCZero. Since this kind of hidden dependency (basically a global object across 2 separate Arduino libraries) is very brittle the depdency is made clear by explicitly registering a function to provide the required timestamp.
1 parent 8d36c65 commit edbca65

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: src/ArduinoIoTCloudTCP.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort) {
140140
mqttClientBegin();
141141

142142
Thing.begin();
143+
Thing.registerGetTimeCallbackFunc(getTime);
143144
return 1;
144145
}
145146

0 commit comments

Comments
 (0)