49 bool acquired =
false;
50 unsigned long acquiredMs = 0;
51 unsigned long reportedSeconds = 0;
58 float getSwd(
unsigned long nowMs,
int zone = 0);
61 double getU(
unsigned long nowMs);
65 bool omGetHms(
float secondsWithinDay,
int &hourOut,
int &minuteOut,
float &secondOut);
66 bool omGetHms(
float secondsWithinDay,
int &hourOut,
int &minuteOut,
int &secondOut);
82 void tick(
unsigned int deltaMillis);
112 bool getTime(
int &hourOut,
int &minuteOut,
int &secondOut);
114 bool getTime(
int &hourOut,
int &minuteOut,
float &secondOut);
120 bool getUTime(uint32_t &uTimeOut,
int &uFracOut);
129 const char *ntpServerName =
"";
130 IPAddress ntpServerIp;
131 const char *timeUrl = NULL;
132 unsigned int ntpRequestsSent = 0;
133 unsigned int ntpRequestsAnswered = 0;
134 long ntpRequestMostRecentMillis = -1;
135 unsigned int timeUrlRequestsSent = 0;
136 unsigned int timeUrlRequestsAnswered = 0;
137 long timeUrlRequestMostRecentMillis = 0;
143 static void sGetTimeOfDay(
int &minuteWithinDayOut,
float &secondWithinMinuteOut);
148 void checkForPacket();
150 static const unsigned int kLocalPort = 2390;
155 const char *timeUrl = 0;
156 int timeUrlOffset = 0;
162 static const int kNtpPacketSize = 48;
163 byte packetBuffer[kNtpPacketSize];
164 IPAddress ntpServerIp;
166 bool ntpRequestSent = 0;
168 int localTimeRefetchCountdown = 0;
169 long countdownMilliseconds = -1;
171 static OmNtp *lastNtpBegun;
void tick(unsigned int deltaMillis)
Definition: OmNtp.cpp:361
static OmNtp * ntp()
Definition: OmNtp.cpp:424
void getLocalTime()
Definition: OmNtp.cpp:183
WiFiClient client
Definition: OmNtp.h:174
void setWifiAvailable(bool wifiAvailable)
Definition: OmNtp.cpp:162
const char * getTimeString()
Definition: OmNtp.cpp:280
void setTimeZone(int hourOffset)
Definition: OmNtp.cpp:173
void setTimeUrl(const char *timeUrl)
Definition: OmNtp.cpp:429
void setTimeUrlOffset(int hoursFromTimeUrl)
Definition: OmNtp.cpp:437
bool getTime(int &hourOut, int &minuteOut, int &secondOut)
Definition: OmNtp.cpp:273
static void sGetTimeOfDay(int &minuteWithinDayOut, float &secondWithinMinuteOut)
Static methods to get the time, and return -1's if time does not exist in space.
Definition: OmNtp.cpp:443