[P056] Fix ReadAverage() output params passed by value, always returning 0

Regression from #5369: P056_data_struct::ReadAverage() took float pm25/pm10 by value, so the averaged values never reached the caller and the task values stayed 0. Pass them by reference like CjkSDS011::ReadAverage().
This commit is contained in:
Aleksandr Zharov committed 2026-10-16 11:07:06 +05:00
1 parent 7f5f5d4f35
commit 31ba12eeae
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ float P056_data_struct::GetPM10_() {
}
}
bool P056_data_struct::ReadAverage(float pm25, float pm10) {
bool P056_data_struct::ReadAverage(float& pm25, float& pm10) {
if (isInitialized()) {
return this->SDS->ReadAverage(pm25, pm10);
} else {
+2 -2
View File
@@ -17,8 +17,8 @@ struct P056_data_struct : public PluginTaskData_base {
bool available();
float GetPM2_5();
float GetPM10_();
bool ReadAverage(float pm25,
float pm10);
bool ReadAverage(float& pm25,
float& pm10);
void SetWorkingPeriod(int minutes);
private: