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(){
157157 return getTimeStruct (true );
158158}
159159
160+ bool ArduinoCellular::syncCellularTime (){
161+ // Sync the time with the network NTP service
162+ return syncNTPServer (true ) == 0 ? true : false ;
163+ }
160164
161165void ArduinoCellular::sendSMS (String number, String message){
162166 modem.sendAT (" +CMGF=1" );
Original file line number Diff line number Diff line change @@ -158,13 +158,19 @@ class ArduinoCellular {
158158 * @return The GPS location. If the location is not retrieved, the latitude and longitude will be 0.0.
159159 */
160160 Geolocation getGPSLocation (unsigned long timeout = 60000 );
161-
161+
162162 /* *
163163 * @brief Gets the current time from the network.
164164 * @return The current time.
165165 */
166166 Time getCellularTime ();
167167
168+ /* *
169+ * @brief Sync the modem time using NTP service.
170+ * @return True on success false otherwise.
171+ */
172+ bool syncCellularTime ();
173+
168174 /* *
169175 * @brief Gets the current time from the GPS module.
170176 * @return The current time.
You can’t perform that action at this time.
0 commit comments