diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2018-05-09 14:18:16 -0500 |
---|---|---|
committer | Matthew Barth <msbarth@linux.ibm.com> | 2018-05-17 17:08:59 +0000 |
commit | 1061cba14167d88e9901e6ea50ae58854891ea8e (patch) | |
tree | eac0f40777382d98330562914f04e77d0c093862 /control/fan.hpp | |
parent | 2029106af90bcdfd6a640a21c2c2eff36cb95f67 (diff) | |
download | phosphor-fan-presence-1061cba14167d88e9901e6ea50ae58854891ea8e.tar.gz phosphor-fan-presence-1061cba14167d88e9901e6ea50ae58854891ea8e.zip |
perf: Cache service name for fan target sensors
Cache the service name for each fan target sensor path and use that
service when a new target speed is set on the Target property.
Tested:
Fan target sensor created and set speed functions the same
Change-Id: I3e25e355cf5d31ce814a73c801c6f086fa45531a
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control/fan.hpp')
-rw-r--r-- | control/fan.hpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/control/fan.hpp b/control/fan.hpp index e7f3067..3e05e16 100644 --- a/control/fan.hpp +++ b/control/fan.hpp @@ -59,15 +59,6 @@ class Fan private: /** - * Returns the service name to use for interacting - * with the fan sensor passed in. - * - * @param[in] sensor - the fan tach sensor name - * @return - the service name - */ - std::string getService(const std::string& sensor); - - /** * The dbus object */ sdbusplus::bus::bus& _bus; @@ -78,9 +69,9 @@ class Fan std::string _name; /** - * Vector of hwmon sensors for the rotors + * Map of hwmon target sensors to the service providing them */ - std::vector<std::string> _sensors; + std::map<std::string, std::string> _sensors; /** * The interface of the fan target |