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/sensordatahandler.cpp b/sensordatahandler.cpp
index 4665f38..3f3b04b 100644
--- a/sensordatahandler.cpp
+++ b/sensordatahandler.cpp
@@ -158,6 +158,7 @@
return response;
}
+#ifndef FEATURE_SENSORS_CACHE
GetSensorResponse assertion(const Info& sensorInfo)
{
return mapDbusToAssertion(sensorInfo, sensorInfo.sensorPath,
@@ -197,6 +198,22 @@
return response;
}
+#else
+std::optional<GetSensorResponse> assertion(uint8_t id, const Info& sensorInfo,
+ sdbusplus::message::message& msg)
+{
+ // TODO
+ return {};
+}
+
+std::optional<GetSensorResponse> eventdata2(uint8_t id, const Info& sensorInfo,
+ sdbusplus::message::message& msg)
+{
+ // TODO
+ return {};
+}
+
+#endif // FEATURE_SENSORS_CACHE
} // namespace get