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:
Thomas Basler
2023-08-25 11:04:14 +02:00
parent 08ca221410
commit b88030f76e
3 changed files with 27 additions and 3 deletions

View File

@@ -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;