add requestInterval, lastRequest

add requestInterval, lastRequest
This commit is contained in:
Vlad 2017-05-15 21:37:33 +05:00
parent d08cb88f10
commit 6fb0ced103

View File

@ -7,6 +7,7 @@
#define SEVENZYYEARS 2208988800UL #define SEVENZYYEARS 2208988800UL
#define NTP_PACKET_SIZE 48 #define NTP_PACKET_SIZE 48
#define NTP_DEFAULT_LOCAL_PORT 1337 #define NTP_DEFAULT_LOCAL_PORT 1337
//#define DEBUG_NTPClient
class NTPClient { class NTPClient {
private: private:
@ -17,10 +18,12 @@ class NTPClient {
int _port = NTP_DEFAULT_LOCAL_PORT; int _port = NTP_DEFAULT_LOCAL_PORT;
int _timeOffset = 0; int _timeOffset = 0;
unsigned int _updateInterval = 60000; // In ms unsigned int _updateInterval = 60000; // In ms
unsigned int _requestInterval = 1000; // In ms
unsigned long _currentEpoc = 0; // In s unsigned long _currentEpoc = 0; // In s
unsigned long _lastUpdate = 0; // In ms unsigned long _lastUpdate = 0; // In ms
unsigned long _lastRequest = 0; // In ms
byte _packetBuffer[NTP_PACKET_SIZE]; byte _packetBuffer[NTP_PACKET_SIZE];