Attempt adding sensors with initial read error rc
Sensors that initially returned a read error return code defined to not
have the sensor added to dbus should be attempted to be added after the
monitoring loop for all device sensors has ended. When a sensor object
that was not created due to this is successfully added to dbus, the
sensor is removed from the removal list.
Tested:
Verify a sensor with a defined return code returned is not added
A sensor not initially created is added when successfully read
Change-Id: I5188500fc1a1cdfbcfdb8b3d76e144955489c8fa
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/mainloop.hpp b/mainloop.hpp
index 85c0ea1..d1fe9b0 100644
--- a/mainloop.hpp
+++ b/mainloop.hpp
@@ -96,4 +96,16 @@
std::unique_ptr<phosphor::hwmon::Timer> timer;
/** @brief the sd_event structure */
sd_event* loop = nullptr;
+
+ /**
+ * @brief Map of removed sensors
+ */
+ std::map<SensorSet::key_type, SensorSet::mapped_type> rmSensors;
+
+ /**
+ * @brief Used to create and add sensor objects
+ *
+ * @param[in] sensor - Sensor to create/add object for
+ */
+ void getObject(SensorSet::container_t::const_reference sensor);
};