control: Support `member` signal triggers
`member` signals are signals that a dbus object could send out on dbus
that acts as a notification that does not contain any other data. This
adds support to fan control events that can be triggered by this type of
signal on dbus to essentially run a set of actions. The configuration of
this trigger is contained within the JSON configuration of the trigger
on the event and not against the event's group(s).
i.e.)
"triggers": [
{
"class": "signal",
"signal": "member",
"member":
{
"name": "Pressed",
"path": "/xyz/openbmc_project/Chassis/Buttons/Power0",
"interface": "xyz.openbmc_project.Chassis.Buttons.Power"
}
}
]
Change-Id: Ie7924174333c604fb54c8f18560a890bf6a7c489
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/triggers/signal.hpp b/control/json/triggers/signal.hpp
index 5ec7e2f..2030a5d 100644
--- a/control/json/triggers/signal.hpp
+++ b/control/json/triggers/signal.hpp
@@ -78,6 +78,16 @@
void nameOwnerChanged(Manager* mgr, std::unique_ptr<ActionBase>& action,
const json&);
+/**
+ * @brief Subscribes to a dbus member signal
+ *
+ * @param[in] mgr - Pointer to manager of the trigger
+ * @param[in] action - Action to be run when signal is received
+ * @param[in] jsonObj - JSON object for the trigger
+ */
+void member(Manager* mgr, std::unique_ptr<ActionBase>& action,
+ const json& jsonObj);
+
// Match setup function for signals
using SignalMatch = std::function<void(
Manager*, std::unique_ptr<ActionBase>& action, const json&)>;
@@ -87,7 +97,8 @@
{"properties_changed", propertiesChanged},
{"interfaces_added", interfacesAdded},
{"interfaces_removed", interfacesRemoved},
- {"name_owner_changed", nameOwnerChanged}};
+ {"name_owner_changed", nameOwnerChanged},
+ {"member", member}};
/**
* @brief Trigger to process an event after a signal is received