Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 64771e2

Browse files
authored
v3.7.4 to sync with NTPClient v3.2.1
### Releases v3.7.4 1. Sync with [NTPClient releases v3.2.1](https://github.com/arduino-libraries/NTPClient/releases/tag/3.2.1)
1 parent a443fde commit 64771e2

File tree

11 files changed

+120
-76
lines changed

11 files changed

+120
-76
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Arduino IDE version: 1.8.19
3030
RASPBERRY_PI_PICO board
3131
ArduinoCore-mbed v3.0.1
3232
OS: Ubuntu 20.04 LTS
33-
Linux xy-Inspiron-3593 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
33+
Linux xy-Inspiron-3593 5.13.0-40-generic #45~20.04.1-Ubuntu SMP Mon Apr 4 09:38:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3434
3535
Context:
3636
I encountered an endless loop while trying to connect to Local WiFi.

README.md

Lines changed: 44 additions & 42 deletions
Large diffs are not rendered by default.

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Releases v3.7.4](#releases-v374)
1516
* [Releases v3.7.3](#releases-v373)
1617
* [Releases v3.7.2](#releases-v372)
1718
* [Releases v3.7.1](#releases-v371)
@@ -31,6 +32,11 @@
3132

3233
## Changelog
3334

35+
### Releases v3.7.4
36+
37+
1. Sync with [NTPClient releases v3.2.1](https://github.com/arduino-libraries/NTPClient/releases/tag/3.2.1)
38+
39+
3440
### Releases v3.7.3
3541

3642
1. Use new [Ethernet_Generic library](https://github.com/khoih-prog/Ethernet_Generic) as default for W5x00.

keywords.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ setPoolServerName KEYWORD2
1313
getPoolServerName KEYWORD2
1414
setPoolServerIP KEYWORD2
1515
getPoolServerIP KEYWORD2
16+
setRandomPort KEYWORD2
1617
begin KEYWORD2
1718
update KEYWORD2
1819
updated KEYWORD2
1920
setUpdateCallback KEYWORD2
2021
forceUpdate KEYWORD2
22+
isTimeSet KEYWORD2
2123
getUTCYear KEYWORD2
2224
getUTCMonthStr KEYWORD2
2325
getUTCMonth KEYWORD2

library.json

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "NTPClient_Generic",
3-
"version": "3.7.3",
3+
"version": "3.7.4",
44
"keywords": "timing, device, control, communication, iot, ntp, rtc, wifi, wifinina, ethernet, time, rp2040, nano-rp2040-connect, SAM DUE, SAMD, nRF52, STM32, ESP32, ESP8266, wt32-eth01, rtl8720, rpi-pico",
55
"description": "Library for NTPClient to connect to an NTP time-server. Get time from a NTP time-server and keep it in sync. For ESP8266/ESP32, WT32-ETH01 (ESP32 + LAN8720), nRF52, SAMD21/SAMD51, STM32F/L/H/G/WB/MP1, Teensy, RTL8720DN, RP2040-based (Nano_RP2040_Connect, RASPBERRY_PI_PICO) boards, etc. besides AVR, using ESP WiFi, WiFiNINA, Ethernet W5x00, ENC28J60, LAN8742A, ESP8266/ESP32 AT-command WiFi",
66
"authors":
@@ -36,6 +36,12 @@
3636
"version": ">=1.6.1",
3737
"platforms": ["*"]
3838
},
39+
{
40+
"owner": "khoih-prog",
41+
"name": "Timezone_Generic",
42+
"version": ">=1.10.0",
43+
"platforms": ["*"]
44+
},
3945
{
4046
"owner": "khoih-prog",
4147
"name": "DS323x_Generic",
@@ -54,6 +60,12 @@
5460
"version": ">=1.2.0",
5561
"platforms": ["*"]
5662
},
63+
{
64+
"owner": "khoih-prog",
65+
"name": "FlashStorage_STM32F1",
66+
"version": ">=1.1.0",
67+
"platforms": ["*"]
68+
},
5769
{
5870
"owner": "khoih-prog",
5971
"name": "FlashStorage_RTL8720",
@@ -69,19 +81,19 @@
6981
{
7082
"owner": "khoih-prog",
7183
"name": "EthernetWebServer",
72-
"version": ">=2.1.2",
84+
"version": ">=2.1.3",
7385
"platforms": ["*"]
7486
},
7587
{
7688
"owner": "khoih-prog",
7789
"name": "EthernetWebServer_STM32",
78-
"version": ">=1.4.0",
90+
"version": ">=1.4.1",
7991
"platforms": ["*"]
8092
},
8193
{
8294
"owner": "khoih-prog",
8395
"name": "WiFiWebServer",
84-
"version": ">=1.7.0",
96+
"version": ">=1.8.0",
8597
"platforms": ["*"]
8698
},
8799
{
@@ -99,7 +111,7 @@
99111
{
100112
"owner": "khoih-prog",
101113
"name": "ESP8266_AT_WebServer",
102-
"version": ">=1.5.3",
114+
"version": ">=1.5.4",
103115
"platforms": ["*"]
104116
},
105117
{
@@ -123,7 +135,7 @@
123135
{
124136
"owner": "uipethernet",
125137
"name": "UIPEthernet",
126-
"version": ">=2.0.8",
138+
"version": ">=2.0.11",
127139
"platforms": ["*"]
128140
},
129141
{
@@ -141,7 +153,7 @@
141153
{
142154
"owner": "khoih-prog",
143155
"name": "Ethernet_Generic",
144-
"version": "^2.0.1"
156+
"version": "^2.1.0"
145157
},
146158
{
147159
"owner": "ssilverman",

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=NTPClient_Generic
2-
version=3.7.3
2+
version=3.7.4
33
author=Fabrice Weinberg <fabrice@weinberg.me>, Khoi Hoang <khoih.prog@gmail.com>
44
maintainer=Khoi Hoang <khoih.prog@gmail.com>
55
sentence=Library for NTPClient to connect to an NTP time-server
@@ -9,5 +9,5 @@ url=https://github.com/khoih-prog/NTPClient_Generic
99
architectures=*
1010
repository=https://github.com/khoih-prog/NTPClient_Generic
1111
license=MIT
12-
depends=Time, WiFiNINA_Generic, EthernetWebServer, WiFiWebServer, WebServer_WT32_ETH01, WiFiWebServer_RTL8720, EthernetWebServer_STM32, Ethernet_Generic, EthernetENC, UIPEthernet, STM32duino STM32Ethernet, STM32duino LwIP, STM32duino RTC, FlashStorage_SAMD, FlashStorage_STM32, FlashStorage_RTL8720
12+
depends=Time, WiFiNINA_Generic, EthernetWebServer, WiFiWebServer, WebServer_WT32_ETH01, WiFiWebServer_RTL8720, EthernetWebServer_STM32, Ethernet_Generic, EthernetENC, UIPEthernet, STM32duino STM32Ethernet, STM32duino LwIP, STM32duino RTC, FlashStorage_SAMD, FlashStorage_STM32, FlashStorage_STM32F1, FlashStorage_RTL8720, Timezone_Generic
1313
includes=NTPClient_Generic.h,NTPClient_Generic.hpp

platformio/platformio.ini

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,24 @@ upload_speed = 921600
4242

4343
; Checks for the compatibility with frameworks and dev/platforms
4444
lib_compat_mode = strict
45+
lib_ldf_mode = chain+
46+
;lib_ldf_mode = deep+
4547

4648
lib_deps =
4749
; PlatformIO 4.x
4850
Time@>=1.6.1
51+
Timezone_Generic@>=1.10.0
4952
DS323x_Generic@>=1.3.1
5053
WiFiNINA_Generic@>=1.8.14-3
51-
WiFiWebServer@>=1.7.0
52-
EthernetWebServer@>=2.1.2
53-
EthernetWebServer_STM32@>=1.4.0
54+
WiFiWebServer@>=1.8.0
55+
EthernetWebServer@>=2.1.3
56+
EthernetWebServer_STM32@>=1.4.1
5457
WebServer_WT32_ETH01@>=1.4.1
55-
ESP8266_AT_WebServer@>=1.5.3
56-
Ethernet_Generic>=2.0.1
57-
EthernetENC@>=2.0.1
58-
UIPEthernet@>=2.0.8
59-
STM32duino STM32Ethernet@>=1.2.0
58+
ESP8266_AT_WebServer@>=1.5.4
59+
Ethernet_Generic>=2.1.0
60+
EthernetENC@>=2.0.2
61+
UIPEthernet@>=2.0.11
62+
STM32duino STM32Ethernet@>=1.3.0
6063
STM32duino LwIP@>=2.1.2
6164
STM32duino RTC@>=1.2.0
6265
FlashStorage_SAMD@>=1.3.2
@@ -66,18 +69,19 @@ lib_deps =
6669
WiFiWebServer_RTL8720@>=1.1.1
6770
; PlatformIO 5.x
6871
; paulstoffregen/Time@>=1.6.1
72+
; khoih-prog/Timezone_Generic@>=1.10.0
6973
; khoih-prog/DS323x_Generic@>=1.3.1
7074
; khoih-prog/WiFiNINA_Generic@>=1.8.14-3
71-
; khoih-prog/WiFiWebServer@>=1.7.0
72-
; khoih-prog/EthernetWebServer@>=2.1.2
73-
; khoih-prog/EthernetWebServer_STM32@>=1.4.0
75+
; khoih-prog/WiFiWebServer@>=1.8.0
76+
; khoih-prog/EthernetWebServer@>=2.1.3
77+
; khoih-prog/EthernetWebServer_STM32@>=1.4.1
7478
; khoih-prog/WebServer_WT32_ETH01@>=1.4.1
75-
; khoih-prog/ESP8266_AT_WebServer@>=1.5.3
76-
; khoih-prog/Ethernet_Generic@~2.0.1
77-
; jandrassy/EthernetENC@>=2.0.1
78-
; UIPEthernet/UIPEthernet@>=2.0.8
79+
; khoih-prog/ESP8266_AT_WebServer@>=1.5.4
80+
; khoih-prog/Ethernet_Generic@~2.1.0
81+
; jandrassy/EthernetENC@>=2.0.2
82+
; uipethernet/UIPEthernet@>=2.0.11
7983
; stm32duino/STM32duino LwIP@>=2.1.2
80-
; stm32duino/STM32duino STM32Ethernet@>=1.2.0
84+
; stm32duino/STM32duino STM32Ethernet@>=1.3.0
8185
; stm32duino/STM32duino RTC@>=1.2.0
8286
; khoih-prog/FlashStorage_SAMD@>=1.3.2
8387
; khoih-prog/FlashStorage_STM32@>=1.2.0

src/NTPClient_Generic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/NTPClient_Generic
2020
Licensed under MIT license
2121
22-
Version: 3.7.3
22+
Version: 3.7.4
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -36,6 +36,7 @@
3636
3.7.1 K Hoang 20/01/2022 Fix getUTCEpochMillis() bug
3737
3.7.2 K Hoang 23/02/2022 Add setUDP() function to enable auto-switching between WiFi and Ethernet UDP
3838
3.7.3 K Hoang 05/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
39+
3.7.4 K Hoang 27/04/2022 Sync with NTPClient releases v3.2.1
3940
*****************************************************************************************************************************/
4041

4142
#pragma once

src/NTPClient_Generic.hpp

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/NTPClient_Generic
2020
Licensed under MIT license
2121
22-
Version: 3.7.3
22+
Version: 3.7.4
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -36,6 +36,7 @@
3636
3.7.1 K Hoang 20/01/2022 Fix getUTCEpochMillis() bug
3737
3.7.2 K Hoang 23/02/2022 Add setUDP() function to enable auto-switching between WiFi and Ethernet UDP
3838
3.7.3 K Hoang 05/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
39+
3.7.4 K Hoang 27/04/2022 Sync with NTPClient releases v3.2.1
3940
*****************************************************************************************************************************/
4041

4142
#pragma once
@@ -44,13 +45,13 @@
4445
#ifndef NTPCLIENT_GENERIC_HPP
4546
#define NTPCLIENT_GENERIC_HPP
4647

47-
#define NTPCLIENT_GENERIC_VERSION "NTPClient_Generic v3.7.3"
48+
#define NTPCLIENT_GENERIC_VERSION "NTPClient_Generic v3.7.4"
4849

4950
#define NTPCLIENT_GENERIC_VERSION_MAJOR 3
5051
#define NTPCLIENT_GENERIC_VERSION_MINOR 7
51-
#define NTPCLIENT_GENERIC_VERSION_PATCH 3
52+
#define NTPCLIENT_GENERIC_VERSION_PATCH 4
5253

53-
#define NTPCLIENT_GENERIC_VERSION_INT 3007003
54+
#define NTPCLIENT_GENERIC_VERSION_INT 3007004
5455

5556
#include "Arduino.h"
5657

@@ -166,6 +167,15 @@ class NTPClient
166167
{
167168
return (this->_poolServerIP);
168169
}
170+
171+
/**
172+
* Set random local port
173+
*/
174+
void setRandomPort(uint16_t minValue = 49152, uint16_t maxValue = 65535)
175+
{
176+
randomSeed(millis());
177+
this->_port = random(minValue, maxValue);
178+
}
169179

170180
/**
171181
Starts the underlying UDP client with the specified local port
@@ -188,6 +198,11 @@ class NTPClient
188198
{
189199
return (this->_currentEpoc != 0);
190200
}
201+
202+
bool isTimeSet() const
203+
{
204+
return (this->_lastUpdate != 0); // returns true if the time has been set, else false
205+
}
191206

192207
/**
193208
Register a callback function for when the time gets updated

src/NTPClient_Generic_Debug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/NTPClient_Generic
2020
Licensed under MIT license
2121
22-
Version: 3.7.3
22+
Version: 3.7.4
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -36,6 +36,7 @@
3636
3.7.1 K Hoang 20/01/2022 Fix getUTCEpochMillis() bug
3737
3.7.2 K Hoang 23/02/2022 Add setUDP() function to enable auto-switching between WiFi and Ethernet UDP
3838
3.7.3 K Hoang 05/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
39+
3.7.4 K Hoang 27/04/2022 Sync with NTPClient releases v3.2.1
3940
*****************************************************************************************************************************/
4041

4142
#pragma once

0 commit comments

Comments
 (0)