Boot count using setter and getter

This commit is contained in:
samuelbles07
2024-11-21 02:30:03 +07:00
parent 3ca2d1d208
commit 2be91b3968
6 changed files with 22 additions and 13 deletions
+7 -3
View File
@@ -601,8 +601,8 @@ String Measurements::toString(bool localServer, AgFirmwareMode fwMode, int rssi,
}
}
root["boot"] = bootCount;
root["bootCount"] = bootCount;
root["boot"] = _bootCount;
root["bootCount"] = _bootCount;
root["wifi"] = rssi;
if (localServer) {
@@ -1065,4 +1065,8 @@ JSONVar Measurements::buildPMS(AirGradient &ag, int ch, bool allCh, bool withTem
return pms;
}
void Measurements::setDebug(bool debug) { _debug = debug; }
void Measurements::setDebug(bool debug) { _debug = debug; }
int Measurements::bootCount() { return _bootCount; }
void Measurements::setBootCount(int bootCount) { _bootCount = bootCount; }
+3 -2
View File
@@ -147,8 +147,8 @@ public:
*/
void setDebug(bool debug);
// TODO: update this to use setter
int bootCount;
int bootCount();
void setBootCount(int bootCount);
private:
// Some declared as an array (channel), because FW_MODE_O_1PPx has two PMS5003T
@@ -171,6 +171,7 @@ private:
IntegerValue _pm_25_pc[2]; // particle count 2.5
IntegerValue _pm_5_pc[2]; // particle count 5.0
IntegerValue _pm_10_pc[2]; // particle count 10
int _bootCount;
bool _debug = false;