Move status iface creation into sensor object
For sensors that have a status interface created with a functional
property set according to its fault sysfs file value, the object
associated with the sensor should contain the creation of this
interface.
Tested:
No change in status interface creation for sensors
Change-Id: Ic3c0a81c661ac481b90ad9bd4c8bf415dae3520e
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/sensor.hpp b/sensor.hpp
index 4d3dc3c..978467b 100644
--- a/sensor.hpp
+++ b/sensor.hpp
@@ -27,31 +27,36 @@
* @brief Constructs Sensor object
*
* @param[in] sensor - A pair of sensor indentifiers
+ * @param[in] ioAccess - Hwmon sysfs access
+ * @param[in] devPath - Device sysfs path
*/
- explicit Sensor(const SensorSet::key_type& sensor);
+ explicit Sensor(const SensorSet::key_type& sensor,
+ const hwmonio::HwmonIO& ioAccess,
+ const std::string& devPath);
+
+ /**
+ * @brief Add status interface and functional property for sensor
+ * @details When a sensor has an associated fault file, the
+ * OperationalStatus interface is added along with setting the
+ * Functional property to the corresponding value found in the
+ * fault file.
+ *
+ * @param[in] info - Sensor object information
+ *
+ * @return - Shared pointer to the status object
+ */
+ std::shared_ptr<StatusObject> addStatus(
+ ObjectInfo& info);
private:
/** @brief Sensor object's identifiers */
SensorSet::key_type sensor;
-};
-/**
- * @brief Add status interface and functional property for sensor
- * @details When a sensor has an associated fault file, the OperationalStatus
- * interface is added along with setting the Functional property to the
- * corresponding value found in the fault file.
- *
- * @param[in] sensor - Sensor identification data
- * @param[in] ioAccess - I/O access to sysfs
- * @param[in] devPath - Device path
- * @param[in] info - Sensor object information
- *
- * @return - Shared pointer to the status object
- */
-std::shared_ptr<StatusObject> addStatus(
- const SensorSet::key_type& sensor,
- const hwmonio::HwmonIO& ioAccess,
- const std::string& devPath,
- ObjectInfo& info);
+ /** @brief Hwmon sysfs access. */
+ const hwmonio::HwmonIO& ioAccess;
+
+ /** @brief Physical device sysfs path. */
+ const std::string& devPath;
+};
} // namespace sensor