sensor-cache: Use new get function
The get function for sensor-cache will use the sdbusplus message to get
the sensor data instead of making DBus calls, where the sdbusplus
message could be a signal callback, or the getAllProperty's reply message.
So the get function's prototype is changed.
Tested: Verify the build is OK when enable or disable the sensor-cache
option.
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Ife2f55d87ce2b0941a4efdb599e46d80d827c2ff
diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp
index 9c59ea0..3332f81 100644
--- a/include/ipmid/types.hpp
+++ b/include/ipmid/types.hpp
@@ -172,7 +172,13 @@
SensorUnits1 sensorUnits1;
Unit unit;
std::function<uint8_t(SetSensorReadingReq&, const Info&)> updateFunc;
+#ifndef FEATURE_SENSORS_CACHE
std::function<GetSensorResponse(const Info&)> getFunc;
+#else
+ std::function<std::optional<GetSensorResponse>(
+ uint8_t, const Info&, sdbusplus::message::message&)>
+ getFunc;
+#endif
Mutability mutability;
SensorName sensorName;
std::function<SensorName(const Info&)> sensorNameFunc;