Add getIndirectID function
This function will look up the sensor ID for a sensor when
it is specified in a label file in hwmon sysfs.
This functionality was previously all contained in
getIndirectlLabelEnv(). A future commit will remove this
function entirely and just use getIndirectID() and getEnv()
to look up the label for the indirect case.
Change-Id: Ifeb636eb0e58a6204f782f64e9aba839b812a967
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/env.hpp b/env.hpp
index 6342e25..e1169e1 100644
--- a/env.hpp
+++ b/env.hpp
@@ -27,6 +27,18 @@
const std::string& type,
const std::string& id);
+/** @brief Gets the ID for the sensor with a level of indirection
+ *
+ * Read the sensor number/ID from the <path>/<item><X>_label file.
+ * <item> & <X> are populated from the sensor key.
+ *
+ * @param[in] path - Directory path of the label file
+ * @param[in] sensor - Sensor details
+ */
+std::string getIndirectID(
+ std::string path,
+ const SensorSet::key_type& sensor);
+
/** @brief Get the label for the sensor with a level of indirection.
*
* Read the sensor number from the <path>/<item><X>_label file.<item> & <X> is