Skip to content

Commit

Permalink
TimeService: do no use NTP if we are using cellular connection
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed May 2, 2024
1 parent c28addc commit 840513a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utility/time/TimeService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 840513a

Please sign in to comment.