You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a feature that I need in multiple projects and I wonder if there is any interest to have it upstream. Briefly, I use arduino (and similar devices) to acquire data at 1 Hz from sensors and then upload it to a server. It is not uncommon that that due to the location of the sensor WiFi is not available from the very beginning and therfore the data is stored in a buffer. As soon as WiFi is available I start transmiting the buffer data to the server. But I need to make sure that the NTPClient has been synced first (that is why I need isSynced function). Currently I am either checking if the date is too old and/or _lastUpdate is zero. Then I have to convert the value of millis that I have stored in each record (insteado of the epoch) and convert it to Epoch. For this purpose I just do:
unsignedlongmillisToEpoch(unsignedlong value) const {
returnthis->_timeOffset + // User offsetthis->_currentEpoc + // Epoc returned by the NTP server
((value - this->_lastUpdate) / 1000); // Time since last update
}
In both cases I need to copy NTPClient as there all these members are private. Have you considered adding these functions or at least making these members protected so we can add this behaviour via subclassing.
The text was updated successfully, but these errors were encountered:
There is a feature that I need in multiple projects and I wonder if there is any interest to have it upstream. Briefly, I use arduino (and similar devices) to acquire data at 1 Hz from sensors and then upload it to a server. It is not uncommon that that due to the location of the sensor WiFi is not available from the very beginning and therfore the data is stored in a buffer. As soon as WiFi is available I start transmiting the buffer data to the server. But I need to make sure that the NTPClient has been synced first (that is why I need
isSynced
function). Currently I am either checking if the date is too old and/or_lastUpdate
is zero. Then I have to convert the value of millis that I have stored in each record (insteado of the epoch) and convert it to Epoch. For this purpose I just do:In both cases I need to copy NTPClient as there all these members are private. Have you considered adding these functions or at least making these members protected so we can add this behaviour via subclassing.
The text was updated successfully, but these errors were encountered: