diff options
author | Kirill Pakhomov <k.pakhomov@yadro.com> | 2018-11-02 19:00:18 +0300 |
---|---|---|
committer | Vernon Mauery <vernon.mauery@linux.intel.com> | 2019-02-12 21:07:11 +0000 |
commit | a257362278c2a92676f7ef8b774d2dc3fb382fb2 (patch) | |
tree | 4418d66d7ff4f7d141885bcc7946122adf86c053 /dcmihandler.hpp | |
parent | 4b0ddb68b4e76420358589213bc400155fa12e43 (diff) | |
download | phosphor-host-ipmid-a257362278c2a92676f7ef8b774d2dc3fb382fb2.tar.gz phosphor-host-ipmid-a257362278c2a92676f7ef8b774d2dc3fb382fb2.zip |
dcmihandler: Add parameterization to JSON parser method.
Pass JSON config file name as a parameter
to make parser re-usable with various config files.
Change-Id: I5bf1e91121e0e75be58383151f265b32f39a5b60
Signed-off-by: Kirill Pakhomov <k.pakhomov@yadro.com>
Diffstat (limited to 'dcmihandler.hpp')
-rw-r--r-- | dcmihandler.hpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/dcmihandler.hpp b/dcmihandler.hpp index 29757ff..e3fa9de 100644 --- a/dcmihandler.hpp +++ b/dcmihandler.hpp @@ -42,7 +42,7 @@ static constexpr auto networkConfigIntf = static constexpr auto hostNameProp = "HostName"; static constexpr auto temperatureSensorType = 0x01; static constexpr auto maxInstances = 255; -static constexpr auto configFile = +static constexpr auto gDCMISensorsConfig = "/usr/share/ipmi-providers/dcmi_sensors.json"; static constexpr auto ethernetIntf = "xyz.openbmc_project.Network.EthernetInterface"; @@ -54,6 +54,8 @@ static constexpr auto dhcpIntf = static constexpr auto systemBusName = "org.freedesktop.systemd1"; static constexpr auto systemPath = "/org/freedesktop/systemd1"; static constexpr auto systemIntf = "org.freedesktop.systemd1.Manager"; +static constexpr auto gDCMICapabilitiesConfig = + "/usr/share/ipmi-providers/dcmi_cap.json"; namespace assettag { @@ -411,12 +413,13 @@ struct GetTempReadingsResponseHdr uint8_t numDataSets; //!< No. of sets of temperature data } __attribute__((packed)); -/** @brief Parse out JSON config file containing information - * related to sensors. +/** @brief Parse out JSON config file. + * + * @param[in] configFile - JSON config file name * * @return A json object */ -Json parseSensorConfig(); +Json parseJSONConfig(const std::string& configFile); namespace temp_readings { |