Sensors: Move objectPropertiesToJson() to sensor_utils
This commit move objectPropertiesToJson() to the sensor_utils class.
This is in preparation for building sensor excerpts using the same code
which builds a sensor. By moving the function into the sensor utility
class it should help with compile time by not needing to include all of
sensor code by the files implementing the excerpts.
Additional functions and definitions were moved into the sensor_utils
class as well due to dependencies from objectPropertiesToJson().
Tested:
- Confirmed output unchanged for following URI:
- /redfish/v1/Chassis/chassis/Sensors
- Selection of: /redfish/v1/Chassis/chassis/Sensors/<sensorId>
- /redfish/v1/Chassis/chassis/Sensors?\$expand=*
- Redfish Validator passes
Change-Id: I563a560b5b2760e0421c1402d51216101af40be2
Signed-off-by: Janet Adkins <janeta@us.ibm.com>
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index 7a5586f..90a7b85 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -20,6 +20,7 @@
#include "registries/privilege_registry.hpp"
#include "sensors.hpp"
#include "utils/json_utils.hpp"
+#include "utils/sensor_utils.hpp"
namespace redfish
{
@@ -39,7 +40,7 @@
auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
asyncResp, chassisName, sensors::dbus::thermalPaths,
- sensors::node::thermal);
+ sensor_utils::thermalNode);
// TODO Need to get Chassis Redundancy information.
getChassisData(sensorAsyncResp);
@@ -66,7 +67,7 @@
auto sensorsAsyncResp = std::make_shared<SensorsAsyncResp>(
asyncResp, chassisName, sensors::dbus::thermalPaths,
- sensors::node::thermal);
+ sensor_utils::thermalNode);
if (!json_util::readJsonPatch(
req, sensorsAsyncResp->asyncResp->res, "Temperatures",