Skip to content

Commit 771dd0a

Browse files
committed
pldm: Sensor polling after setting numeric effecter
Polling for value of a numeric sensor that has a corrospoinding numeric effecter is disabled since the polling returns error until the numeric effecter is set to an pertinent value. Once a numeric effecter is set with a pertinent value using D-Bus set-property method, enable polling the corresponding numeric sensor for its value. Signed-off-by: Shirish Pargaonkar <Shirish.Pargaonkar@amd.com>
1 parent 7e94769 commit 771dd0a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

platform-mc/effecters/numeric/effecter.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,17 @@ exec::task<int> NumericEffecter::setNumericEffecterValue(double effecterValue)
432432
co_return completionCode;
433433
}
434434

435+
#ifdef OEM_AMD
436+
auto it = std::find_if(terminus.numericSensors.begin(), terminus.numericSensors.end(),
437+
[this](const auto& sensor) { return sensor->sensorId == this->effecterId; });
438+
439+
if (it != terminus.numericSensors.end())
440+
{
441+
lg2::info("Enable polling for sensor ID: {SID}", "SID", (*it)->sensorId);
442+
(*it)->updateTime = static_cast<uint64_t>(DEFAULT_SENSOR_UPDATER_INTERVAL * 1000);
443+
}
444+
#endif
445+
435446
co_await getNumericEffecterValue();
436447

437448
co_return completionCode;

0 commit comments

Comments
 (0)