summaryrefslogtreecommitdiffstats
path: root/fan_enclosure.hpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2017-02-23 10:16:57 -0600
committerMatthew Barth <msbarth@us.ibm.com>2017-03-15 16:04:21 -0500
commit8db0f6f96401b9e0598836f761b808b590ce3f38 (patch)
treeda45d2e1be7d9cf94b2bc8202cbf264be4e14ded /fan_enclosure.hpp
parentfefdc45eec58f4c6c75d05b156df2dfbae421cd3 (diff)
downloadphosphor-fan-presence-8db0f6f96401b9e0598836f761b808b590ce3f38.tar.gz
phosphor-fan-presence-8db0f6f96401b9e0598836f761b808b590ce3f38.zip
Only update inventory when presence state changes
When the presence state of a fan enclosure, determined from all the sensors part of that fan enclosure, changes then update inventory. Change-Id: Ie80e83fa7d0200239ced7b9d2ef84664e599e8ca Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'fan_enclosure.hpp')
-rw-r--r--fan_enclosure.hpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/fan_enclosure.hpp b/fan_enclosure.hpp
index cd9f689..da6f7e5 100644
--- a/fan_enclosure.hpp
+++ b/fan_enclosure.hpp
@@ -12,6 +12,13 @@ namespace fan
namespace presence
{
+typedef enum presenceState
+{
+ NOT_PRESENT,
+ PRESENT,
+ UNKNOWN
+} presenceState;
+
class FanEnclosure
{
using Property = std::string;
@@ -52,10 +59,12 @@ class FanEnclosure
const std::string invPath;
const std::string fanDesc;
std::vector<std::unique_ptr<Sensor>> sensors;
+ presenceState presState = UNKNOWN;
+ presenceState getCurPresState();
//TODO openbmc/openbmc#1299 - Move getInvService() to a utility file
std::string getInvService();
- ObjectMap getObjectMap();
+ ObjectMap getObjectMap(bool curPresState);
};
OpenPOWER on IntegriCloud