mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-17 07:41:52 +01:00
Feature: Re-Request DevInfo if it contains invalid data
It can sometimes occour that the DevInfo request returns invalid data. Currently this is identified if the firmware build year is < 2016. In this case the package will be re-requested now.
This commit is contained in:
@@ -196,6 +196,16 @@ String DevInfoParser::getHwModelName()
|
||||
return devInfo[idx].modelName;
|
||||
}
|
||||
|
||||
bool DevInfoParser::containsValidData()
|
||||
{
|
||||
time_t t = getFwBuildDateTime();
|
||||
|
||||
struct tm info;
|
||||
localtime_r(&t, &info);
|
||||
|
||||
return info.tm_year > (2016 - 1900);
|
||||
}
|
||||
|
||||
uint8_t DevInfoParser::getDevIdx()
|
||||
{
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
Reference in New Issue
Block a user