add nox_index to payload

This commit is contained in:
Phat Nguyen
2024-03-03 22:24:58 +07:00
parent 3f1da6387b
commit 6cf5e31843
4 changed files with 31 additions and 2 deletions

View File

@ -121,6 +121,7 @@ void Sgp41::_handle(void) {
vTaskDelay(pdMS_TO_TICKS(1000));
if (getRawSignal(srawVoc, srawNox)) {
tvocRaw = srawVoc;
noxRaw = srawNox;
nox = noxAlgorithm()->process(srawNox);
tvoc = vocAlgorithm()->process(srawVoc);
AgLog("Polling SGP41 success: tvoc: %d, nox: %d", tvoc, nox);
@ -249,3 +250,10 @@ bool Sgp41::_noxConditioning(void) {
* @return int
*/
int Sgp41::getTvocRaw(void) { return tvocRaw; }
/**
* @brief Get NOX raw value
*
* @return int
*/
int Sgp41::getNoxRaw(void) { return noxRaw; }