control: JSON parsing compile framework
Add the enabling framework of use of JSON config files for fan control.
Tested:
Compile passes when `--enable-json` configure flag given
Compile passes without enabling JSON
No functional change when not using JSON
Change-Id: Ic70bfc63ad74cb79559ed839784cd214df403cb2
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/manager.cpp b/control/manager.cpp
index 543d42f..d202fea 100644
--- a/control/manager.cpp
+++ b/control/manager.cpp
@@ -90,6 +90,7 @@
// actual system configuration.
// Find the 1 ZoneGroup that meets all of its conditions
+#ifndef CONTROL_USE_JSON
for (auto& group : _zoneLayouts)
{
auto& conditions = std::get<conditionListPos>(group);
@@ -114,6 +115,7 @@
break;
}
}
+#endif
if (mode == Mode::control)
{
@@ -127,13 +129,13 @@
{
z.second->setFullSpeed();
}
-
+#ifndef CONTROL_USE_JSON
auto delay = _powerOnDelay;
while (delay > 0)
{
delay = sleep(delay);
}
-
+#endif
util::SDBusPlus::callMethod(_bus, SYSTEMD_SERVICE, SYSTEMD_OBJ_PATH,
SYSTEMD_INTERFACE, "StartUnit",
FAN_CONTROL_READY_TARGET, "replace");