Added support for Enabled property
Enabled property is added so that user can select via dbus interface if
Readings are updated and signal on Readings update is emitted, moreover
Metric calculation on received sensor data is active only when Enabled
is set to true
Tested:
- New unit tests were created, ran all new and previous UTs, all passed
- Tested under QEMU by adding reports for single and multiple sensors,
changing Enabled property and emitting signal of value change for
sensors added into the report, checking if Readings is accordingly
updated or not updated
- Verified persistency, if Enabled property is successfully stored and
restored after Telemetry service restart and also checked if after the
restart dependencies of Enabled (Readings, Metric calculation) are
properly initiated
Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>
Change-Id: I29cf13693a48d15cb16d2ad6707f483f67f4879b
diff --git a/src/sensor.hpp b/src/sensor.hpp
index e3334a0..23c3d5c 100644
--- a/src/sensor.hpp
+++ b/src/sensor.hpp
@@ -28,6 +28,8 @@
Id id() const override;
void registerForUpdates(
const std::weak_ptr<interfaces::SensorListener>& weakListener) override;
+ void unregisterFromUpdates(
+ const std::weak_ptr<interfaces::SensorListener>& weakListener) override;
private:
static std::optional<double> readValue(const ValueVariant& v);