regulators: Implements support for pmbus_read_sensor action

Enhance the configuration file parser to support the pmbus_read_sensor
action element.

Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: I7f87a7551469bb494fe17b6d6d79ebb1ca517e86
diff --git a/phosphor-regulators/src/config_file_parser.hpp b/phosphor-regulators/src/config_file_parser.hpp
index 205f43a..848ed95 100644
--- a/phosphor-regulators/src/config_file_parser.hpp
+++ b/phosphor-regulators/src/config_file_parser.hpp
@@ -32,6 +32,7 @@
 #include "if_action.hpp"
 #include "not_action.hpp"
 #include "or_action.hpp"
+#include "pmbus_read_sensor_action.hpp"
 #include "pmbus_write_vout_command_action.hpp"
 #include "presence_detection.hpp"
 #include "rail.hpp"
@@ -508,6 +509,19 @@
 std::unique_ptr<OrAction> parseOr(const nlohmann::json& element);
 
 /**
+ * Parses a JSON element containing a pmbus_read_sensor action.
+ *
+ * Returns the corresponding C++ PMBusReadSensorAction object.
+ *
+ * Throws an exception if parsing fails.
+ *
+ * @param element JSON element
+ * @return PMBusReadSensorAction object
+ */
+std::unique_ptr<PMBusReadSensorAction>
+    parsePMBusReadSensor(const nlohmann::json& element);
+
+/**
  * Parses a JSON element containing a pmbus_write_vout_command action.
  *
  * Returns the corresponding C++ PMBusWriteVoutCommandAction object.
@@ -629,6 +643,19 @@
 std::unique_ptr<RunRuleAction> parseRunRule(const nlohmann::json& element);
 
 /**
+ * Parses a JSON element containing a SensorDataFormat expressed as a string.
+ *
+ * Returns the corresponding SensorDataFormat enum value.
+ *
+ * Throws an exception if parsing fails.
+ *
+ * @param element JSON element
+ * @return SensorDataFormat enum value
+ */
+pmbus_utils::SensorDataFormat
+    parseSensorDataFormat(const nlohmann::json& element);
+
+/**
  * Parses a JSON element containing a sensor monitoring operation.
  *
  * Returns the corresponding C++ SensorMonitoring object.
@@ -642,6 +669,19 @@
     parseSensorMonitoring(const nlohmann::json& element);
 
 /**
+ * Parses a JSON element containing a SensorValueType expressed as a string.
+ *
+ * Returns the corresponding SensorValueType enum value.
+ *
+ * Throws an exception if parsing fails.
+ *
+ * @param element JSON element
+ * @return SensorValueType enum value
+ */
+pmbus_utils::SensorValueType
+    parseSensorValueType(const nlohmann::json& element);
+
+/**
  * Parses a JSON element containing a set_device action.
  *
  * Returns the corresponding C++ SetDeviceAction object.
@@ -725,6 +765,18 @@
 }
 
 /**
+ * Parses a JSON element containing a VoutDataFormat expressed as a string.
+ *
+ * Returns the corresponding VoutDataFormat enum value.
+ *
+ * Throws an exception if parsing fails.
+ *
+ * @param element JSON element
+ * @return VoutDataFormat enum value
+ */
+pmbus_utils::VoutDataFormat parseVoutDataFormat(const nlohmann::json& element);
+
+/**
  * Verifies that the specified JSON element is a JSON array.
  *
  * Throws an invalid_argument exception if the element is not an array.