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 @@ -158,6 +158,10 @@ Time ArduinoCellular::getCellularTime(){
158158 return getTimeStruct (true );
159159}
160160
161+ bool ArduinoCellular::syncCellularTime (){
162+ // Sync the time with the network NTP service
163+ return syncNTPServer (true ) == 0 ? true : false ;
164+ }
161165
162166void ArduinoCellular::sendSMS (String number, String message){
163167 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