From a257362278c2a92676f7ef8b774d2dc3fb382fb2 Mon Sep 17 00:00:00 2001 From: Kirill Pakhomov Date: Fri, 2 Nov 2018 19:00:18 +0300 Subject: 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 --- dcmihandler.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'dcmihandler.hpp') 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 { -- cgit v1.2.1