From 81748b1425e453b6a815a7b8ed2fa861d3068ac7 Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Wed, 2 May 2018 16:03:48 -0500 Subject: Support optional conditions on creating fans This adds the functional infrastructure to optionally attach a condition function to a fan definition. When a condition is defined on a fan, it must be true for a fan's associated functional properties to be created. When the given condition fails, that fan's functional properties will not be created by fan monitor. A fan without a defined condition will have all of its associated functional properties created. Example of generated condition (generation commit to follow): make_condition(condition::propertiesMatch( std::vector{ PropertyState{ PropertyIdentity{ "/xyz/openbmc_project/inventory/system/chassis", "xyz.openbmc_project.Inventory.Decorator.CoolingType", "WaterCooled" }, static_cast(false) } } )), Tested: Fan functional properties are not created when a condition fails Fan functional properties are created when condition passes Fan functional properties are created when no condition exists Change-Id: I9ced2e520d2f97e6655c9417970b3e976d78fef4 Signed-off-by: Matthew Barth --- monitor/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'monitor/Makefile.am') diff --git a/monitor/Makefile.am b/monitor/Makefile.am index 8eda1e0..bea0933 100644 --- a/monitor/Makefile.am +++ b/monitor/Makefile.am @@ -8,7 +8,8 @@ phosphor_fan_monitor_SOURCES = \ argument.cpp \ fan.cpp \ main.cpp \ - tach_sensor.cpp + tach_sensor.cpp \ + conditions.cpp nodist_phosphor_fan_monitor_SOURCES = \ fan_monitor_defs.cpp -- cgit v1.2.1