diff options
author | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-07-21 19:02:37 +0530 |
---|---|---|
committer | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-08-02 22:52:39 +0530 |
commit | 6add0b810bfd859ad21cb6b3f98b0bbfaa15aa62 (patch) | |
tree | 6ad789b4d8617d8b19f749c020a04e843bd647b4 /occ_status.hpp | |
parent | 5f031f3c722f0a4d10e562f5cfa54ba32d12958e (diff) | |
download | openpower-occ-control-6add0b810bfd859ad21cb6b3f98b0bbfaa15aa62.tar.gz openpower-occ-control-6add0b810bfd859ad21cb6b3f98b0bbfaa15aa62.zip |
Use generated occ to sensor ID map
Change-Id: I948cc33ef05c2c49353277f4d5df958012a9801f
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'occ_status.hpp')
-rw-r--r-- | occ_status.hpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/occ_status.hpp b/occ_status.hpp index f426048..d30d642 100644 --- a/occ_status.hpp +++ b/occ_status.hpp @@ -13,6 +13,12 @@ namespace occ namespace Base = sdbusplus::org::open_power::OCC::server; using Interface = sdbusplus::server::object::object<Base::Status>; +// OCC status instance. Ex. for "occ0", the instance is 0 +using instanceID = int; + +// IPMI sensor ID for a given OCC instance +using sensorID = uint8_t; + /** @class Status * @brief Implementation of OCC Active Status */ @@ -35,8 +41,9 @@ class Status : public Interface Status(sdbusplus::bus::bus& bus, EventPtr& event, const char* path) : Interface(bus, path), path(path), + instance(((this->path.back() - '0'))), device(event, - name + std::to_string((this->path.back() - '0') + 1), + name + std::to_string(instance + 1), std::bind(&Status::deviceErrorHandler, this)) { // Nothing to do here @@ -63,6 +70,12 @@ class Status : public Interface /** @brief occ name prefix */ std::string name = OCC_NAME; + /** @brief OCC instance number. Ex, 0,1, etc */ + int instance; + + /** @brief OCC instance to Sensor ID mapping */ + static const std::map<instanceID, sensorID> sensorMap; + /** @brief OCC device object to do bind and unbind */ Device device; |