sensor: Implement sensor "ACCURACY"
Support the accuracy attribute of the sensor. Since the latest
Redfish spec needs to support the accuracy attribute of the sensor,
extend the configuration file syntax to support the accuracy value,
read the value and publish it to the new D-Bus Accuracy interface.
Also, This function will be synchronized to the dbus sensors repo in
the future.
Tested: Build phosphor-hwmon successfully
eg: The configuration accuracy in power supply is 1
~# busctl get-property xyz.openbmc_project.Hwmon-xxx.Hwmon1
/xyz/openbmc_project/sensors/power/ps0_input_power
xyz.openbmc_project.Sensor.Accuracy Accuracy
d 1
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Idd0159b75a7506001cf886f4ae8a22dbd38b1135
diff --git a/mainloop.hpp b/mainloop.hpp
index a187b39..468223b 100644
--- a/mainloop.hpp
+++ b/mainloop.hpp
@@ -23,7 +23,8 @@
static constexpr auto sensorID = 0;
static constexpr auto sensorLabel = 1;
-using SensorIdentifiers = std::tuple<std::string, std::string>;
+static constexpr auto sensorAccuracy = 2;
+using SensorIdentifiers = std::tuple<std::string, std::string, std::string>;
/** @class MainLoop
* @brief hwmon-readd main application loop.