Fix: missing handle serverConfig ledBarTestRequested test

This commit is contained in:
Phat Nguyen
2024-02-06 10:52:01 +07:00
parent 4df0fc5d5c
commit ac9efccd94

View File

@ -215,6 +215,8 @@ public:
/** Get "co2CalibrationRequested" */
if (JSON.typeof_(root["co2CalibrationRequested"]) == "boolean") {
co2Calib = root["co2CalibrationRequested"];
} else {
co2Calib = false;
}
/** Get "ledBarMode" */
@ -260,6 +262,13 @@ public:
co2AbcCalib = -1;
}
/** Get "ledBarTestRequested" */
if (JSON.typeof_(root["ledBarTestRequested"]) == "boolean") {
ledBarTestRequested = root["ledBarTestRequested"];
} else {
ledBarTestRequested = false;
}
/** Show configuration */
showServerConfig();
@ -342,6 +351,20 @@ public:
return ret;
}
/**
* @brief Get request LedBar test
*
* @return true Requested. If result = true, it's clear after function call
* @return false Not-requested
*/
bool isLedBarTestRequested(void) {
bool ret = ledBarTestRequested;
if (ret) {
ledBarTestRequested = false;
}
return ret;
}
/**
* @brief Get the Co2 auto calib period
*
@ -389,6 +412,7 @@ private:
bool configFailed; /** Flag indicate get server configuration failed */
bool serverFailed; /** Flag indicate post data to server failed */
bool co2Calib; /** Is co2Ppmcalibration requset */
bool ledBarTestRequested; /** */
int co2AbcCalib = -1; /** update auto calibration number of day */
UseLedBar ledBarMode = UseLedBarCO2; /** */
char models[20]; /** */
@ -943,6 +967,9 @@ static void serverConfigPoll(void) {
Serial.println("Set S8 auto calib failed");
}
}
if (agServer.isLedBarTestRequested()) {
ledTest();
}
}
}