control: Use event groups on `signal` triggers
Use the provided event groups when enabling any `signal` triggers
instead of the action groups. Event groups are what's used with setting
up event triggers and may or may not be a different set of groups than
what's used when actions are run depending on event configuration.
Change-Id: I78b6255ada52ed718469a6700b4bc2603b2a85cb
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/triggers/signal.hpp b/control/json/triggers/signal.hpp
index 2030a5d..881673a 100644
--- a/control/json/triggers/signal.hpp
+++ b/control/json/triggers/signal.hpp
@@ -37,6 +37,7 @@
*
* @param[in] match - Signal match string to subscribe to
* @param[in] pkg - Data package to attach to signal
+ * @param[in] isSameSig - Function to determine if same signal being subscribed
* @param[in] mgr - Pointer to manager of the trigger
*/
void subscribe(const std::string& match, SignalPkg&& pkg,
@@ -46,51 +47,56 @@
* @brief Subscribes to a propertiesChanged signal
*
* @param[in] mgr - Pointer to manager of the trigger
- * @param[in] action - Action to be run when signal is received
+ * @param[in] group - Group to subscribe signal against
+ * @param[in] actions - Actions to be run when signal is received
*/
-void propertiesChanged(Manager* mgr, std::unique_ptr<ActionBase>& action,
+void propertiesChanged(Manager* mgr, const Group& group, SignalActions actions,
const json&);
/**
* @brief Subscribes to an interfacesAdded signal
*
* @param[in] mgr - Pointer to manager of the trigger
- * @param[in] action - Action to be run when signal is received
+ * @param[in] group - Group to subscribe signal against
+ * @param[in] actions - Actions to be run when signal is received
*/
-void interfacesAdded(Manager* mgr, std::unique_ptr<ActionBase>& action,
+void interfacesAdded(Manager* mgr, const Group& group, SignalActions actions,
const json&);
/**
* @brief Subscribes to an interfacesRemoved signal
*
* @param[in] mgr - Pointer to manager of the trigger
- * @param[in] action - Action to be run when signal is received
+ * @param[in] group - Group to subscribe signal against
+ * @param[in] actions - Actions to be run when signal is received
*/
-void interfacesRemoved(Manager* mgr, std::unique_ptr<ActionBase>& action,
+void interfacesRemoved(Manager* mgr, const Group& group, SignalActions actions,
const json&);
/**
* @brief Subscribes to a nameOwnerChanged signal
*
* @param[in] mgr - Pointer to manager of the trigger
- * @param[in] action - Action to be run when signal is received
+ * @param[in] group - Group to subscribe signal against
+ * @param[in] actions - Actions to be run when signal is received
*/
-void nameOwnerChanged(Manager* mgr, std::unique_ptr<ActionBase>& action,
+void nameOwnerChanged(Manager* mgr, const Group& group, SignalActions actions,
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] group - Group to subscribe signal against
+ * @param[in] actions - Actions to be run when signal is received
* @param[in] jsonObj - JSON object for the trigger
*/
-void member(Manager* mgr, std::unique_ptr<ActionBase>& action,
+void member(Manager* mgr, const Group&, SignalActions actions,
const json& jsonObj);
// Match setup function for signals
-using SignalMatch = std::function<void(
- Manager*, std::unique_ptr<ActionBase>& action, const json&)>;
+using SignalMatch = std::function<void(Manager*, const Group&,
+ SignalActions actions, const json&)>;
/* Supported signals to their corresponding match setup functions */
static const std::unordered_map<std::string, SignalMatch> signals = {
@@ -112,6 +118,6 @@
* configuration, is received.
*/
enableTrigger triggerSignal(const json& jsonObj, const std::string& eventName,
- std::vector<std::unique_ptr<ActionBase>>& actions);
+ SignalActions actions);
} // namespace phosphor::fan::control::json::trigger::signal