Correct typos in comments and documentation
This commit is contained in:
parent
b4dbfbde48
commit
8f22c7d71f
@ -128,7 +128,7 @@ bool NTPClient::update() {
|
|||||||
|
|
||||||
unsigned long NTPClient::getEpochTime() const {
|
unsigned long NTPClient::getEpochTime() const {
|
||||||
return this->_timeOffset + // User offset
|
return this->_timeOffset + // User offset
|
||||||
this->_currentEpoc + // Epoc returned by the NTP server
|
this->_currentEpoc + // Epoch returned by the NTP server
|
||||||
((millis() - this->_lastUpdate) / 1000); // Time since last update
|
((millis() - this->_lastUpdate) / 1000); // Time since last update
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,4 +207,4 @@ void NTPClient::sendNTPPacket() {
|
|||||||
void NTPClient::setRandomPort(unsigned int minValue, unsigned int maxValue) {
|
void NTPClient::setRandomPort(unsigned int minValue, unsigned int maxValue) {
|
||||||
randomSeed(analogRead(0));
|
randomSeed(analogRead(0));
|
||||||
this->_port = random(minValue, maxValue);
|
this->_port = random(minValue, maxValue);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ WiFiUDP ntpUDP;
|
|||||||
NTPClient timeClient(ntpUDP);
|
NTPClient timeClient(ntpUDP);
|
||||||
|
|
||||||
// You can specify the time server pool and the offset, (in seconds)
|
// You can specify the time server pool and the offset, (in seconds)
|
||||||
// additionaly you can specify the update interval (in milliseconds).
|
// additionally you can specify the update interval (in milliseconds).
|
||||||
// NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000);
|
// NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000);
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
@ -48,4 +48,4 @@ void loop() {
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Function documentation
|
## Function documentation
|
||||||
`getEpochTime` returns the unix epoch, which are the seconds elapsed since 00:00:00 UTC on 1 January 1970 (leap seconds are ignored, every day is treated as having 86400 seconds). **Attention**: If you have set a time offset this time offset will be added to your epoch timestamp.
|
`getEpochTime` returns the Unix epoch, which are the seconds elapsed since 00:00:00 UTC on 1 January 1970 (leap seconds are ignored, every day is treated as having 86400 seconds). **Attention**: If you have set a time offset this time offset will be added to your epoch timestamp.
|
||||||
|
@ -11,7 +11,7 @@ const char *password = "<PASSWORD>";
|
|||||||
WiFiUDP ntpUDP;
|
WiFiUDP ntpUDP;
|
||||||
|
|
||||||
// You can specify the time server pool and the offset (in seconds, can be
|
// You can specify the time server pool and the offset (in seconds, can be
|
||||||
// changed later with setTimeOffset() ). Additionaly you can specify the
|
// changed later with setTimeOffset() ). Additionally you can specify the
|
||||||
// update interval (in milliseconds, can be changed using setUpdateInterval() ).
|
// update interval (in milliseconds, can be changed using setUpdateInterval() ).
|
||||||
NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000);
|
NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user