summaryrefslogtreecommitdiffstats
path: root/control/types.hpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2017-05-11 15:00:36 -0500
committerMatthew Barth <msbarth@us.ibm.com>2017-05-31 10:55:48 -0500
commit17d1fe23b704cacb1cdd9b58156f354626b36f8c (patch)
treed448834a4cee7a2f71be26141431459f0808bd98 /control/types.hpp
parent38a93a8aa2feea7f4e785db6b4ff6d9e81f6020d (diff)
downloadphosphor-fan-presence-17d1fe23b704cacb1cdd9b58156f354626b36f8c.tar.gz
phosphor-fan-presence-17d1fe23b704cacb1cdd9b58156f354626b36f8c.zip
Add setting zone speed action
Enable an action to be defined that sets the zone to a given speed when a number of properties are set to a given value Change-Id: I5252a20a24bdb14dee63080f2c08b080c82ad7e8 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control/types.hpp')
-rw-r--r--control/types.hpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/control/types.hpp b/control/types.hpp
index bbbac61..c610ed9 100644
--- a/control/types.hpp
+++ b/control/types.hpp
@@ -19,17 +19,31 @@ constexpr auto fanNamePos = 0;
constexpr auto sensorListPos = 1;
using FanDefinition = std::tuple<std::string, std::vector<std::string>>;
+constexpr auto intfPos = 0;
+constexpr auto propPos = 1;
+using Group = std::map<std::string, std::tuple<std::string, std::string>>;
using Handler = std::function<void(sdbusplus::bus::bus&,
sdbusplus::message::message&,
Zone&)>;
+using Action = std::function<void(Zone&, const Group&)>;
constexpr auto signaturePos = 0;
constexpr auto handlerObjPos = 1;
using PropertyChange = std::tuple<std::string, Handler>;
-using SetSpeedEvent = std::vector<PropertyChange>;
+
+constexpr auto groupPos = 0;
+constexpr auto actionPos = 1;
+constexpr auto propChangeListPos = 2;
+using SetSpeedEvent = std::tuple<Group, Action, std::vector<PropertyChange>>;
+
+constexpr auto eventGroupPos = 0;
+constexpr auto eventHandlerPos = 1;
+constexpr auto eventActionPos = 2;
+using EventData = std::tuple<Group, Handler, Action>;
constexpr auto zoneObjPos = 0;
-using SignalEvent = std::tuple<Zone*, Handler>;
+constexpr auto eventDataPos = 1;
+using SignalEvent = std::tuple<Zone*, EventData>;
constexpr auto zoneNumPos = 0;
constexpr auto fullSpeedPos = 1;
OpenPOWER on IntegriCloud