Skip to content

Commit 3dfe573

Browse files
committed
TimeService: do no use NTP if we are using cellular connection
1 parent dd4c09d commit 3dfe573

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/utility/time/TimeService.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,11 @@ unsigned long TimeServiceClass::getRemoteTime()
292292
* This is the most reliable time source and it will
293293
* ensure a correct behaviour of the library.
294294
*/
295-
unsigned long const ntp_time = NTPUtils::getTime(_con_hdl->getUDP());
296-
if(isTimeValid(ntp_time)) {
297-
return ntp_time;
295+
if(_con_hdl->getInterface() != NetworkAdapter::CELL) {
296+
unsigned long const ntp_time = NTPUtils::getTime(_con_hdl->getUDP());
297+
if(isTimeValid(ntp_time)) {
298+
return ntp_time;
299+
}
298300
}
299301

300302
/* As fallback if NTP request fails try to obtain the

0 commit comments

Comments
 (0)