File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,10 @@ Time ArduinoCellular::getCellularTime(){
157
157
return getTimeStruct (true );
158
158
}
159
159
160
+ bool ArduinoCellular::syncCellularTime (){
161
+ // Sync the time with the network NTP service
162
+ return syncNTPServer (true ) == 0 ? true : false ;
163
+ }
160
164
161
165
void ArduinoCellular::sendSMS (String number, String message){
162
166
modem.sendAT (" +CMGF=1" );
Original file line number Diff line number Diff line change @@ -158,13 +158,19 @@ class ArduinoCellular {
158
158
* @return The GPS location. If the location is not retrieved, the latitude and longitude will be 0.0.
159
159
*/
160
160
Geolocation getGPSLocation (unsigned long timeout = 60000 );
161
-
161
+
162
162
/* *
163
163
* @brief Gets the current time from the network.
164
164
* @return The current time.
165
165
*/
166
166
Time getCellularTime ();
167
167
168
+ /* *
169
+ * @brief Sync the modem time using NTP service.
170
+ * @return True on success false otherwise.
171
+ */
172
+ bool syncCellularTime ();
173
+
168
174
/* *
169
175
* @brief Gets the current time from the GPS module.
170
176
* @return The current time.
You can’t perform that action at this time.
0 commit comments