gmag11 / ESPNtpClient

High accuracy NTP library for ESP32 and ESP8266
MIT License
118 stars 25 forks source link

Bug when check if ntpServerIPAddress is unset #43

Open JyunWei-Su opened 2 years ago

JyunWei-Su commented 2 years ago

In function NTPClient::getTime () (file: ESPNtpClient.cpp), the statement if (ntpServerIPAddress == IPAddress (INADDR_NONE)) only work with ESP32. I think this due to the IPAddress (INADDR_NONE)) is (IP unset) for esp8266, 0.0.0.0 for esp32. Maybe it should be if(ntpServerIPAddress.toString() == IPAddress(INADDR_NONE).toString())