From 3dfe573cd34333e4d1848eec0df3e2ee2f53dc92 Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 2 May 2024 17:12:10 +0200 Subject: [PATCH] TimeService: do no use NTP if we are using cellular connection --- src/utility/time/TimeService.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utility/time/TimeService.cpp b/src/utility/time/TimeService.cpp index 05290b21..5bf081de 100644 --- a/src/utility/time/TimeService.cpp +++ b/src/utility/time/TimeService.cpp @@ -292,9 +292,11 @@ unsigned long TimeServiceClass::getRemoteTime() * This is the most reliable time source and it will * ensure a correct behaviour of the library. */ - unsigned long const ntp_time = NTPUtils::getTime(_con_hdl->getUDP()); - if(isTimeValid(ntp_time)) { - return ntp_time; + if(_con_hdl->getInterface() != NetworkAdapter::CELL) { + unsigned long const ntp_time = NTPUtils::getTime(_con_hdl->getUDP()); + if(isTimeValid(ntp_time)) { + return ntp_time; + } } /* As fallback if NTP request fails try to obtain the