diff options
author | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-06-28 19:17:28 +0530 |
---|---|---|
committer | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-07-06 14:56:34 +0000 |
commit | 32e84e98efd51509aa18ab2f3538bcbc6689bb0d (patch) | |
tree | d19c0e92e84fc4bdda35fcf4811341706e3136ff /occ_status.hpp | |
parent | 307d80b3d78efc669f38a63938371adcc6934391 (diff) | |
download | openpower-occ-control-32e84e98efd51509aa18ab2f3538bcbc6689bb0d.tar.gz openpower-occ-control-32e84e98efd51509aa18ab2f3538bcbc6689bb0d.zip |
Add Support to do device bind and unbind based on OCC status
Fixes openbmc/openbmc#1698
Change-Id: Iaa33c3065b0358b62e3ec7e39d4b57c6b9d181e1
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'occ_status.hpp')
-rw-r--r-- | occ_status.hpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/occ_status.hpp b/occ_status.hpp index 068f83b..5d092b7 100644 --- a/occ_status.hpp +++ b/occ_status.hpp @@ -3,6 +3,7 @@ #include <sdbusplus/bus.hpp> #include <sdbusplus/server/object.hpp> #include <org/open_power/OCC/Status/server.hpp> +#include "occ_device.hpp" namespace open_power { namespace occ @@ -30,11 +31,19 @@ class Status : public Interface * @param[in] path - DBus object path */ Status(sdbusplus::bus::bus& bus, const char* path) - : Interface(bus, path) + : Interface(bus, path), + path(path), + device(name + std::to_string((this->path.back() - '0') + 1)) { // Nothing to do here } + /** @brief Since we are overriding the setter-occActive but not the + * getter-occActive, we need to have this using in order to + * allow passthrough usage of the getter-occActive + */ + using Base::Status::occActive; + /** @brief SET OccActive to True or False * * @param[in] value - Intended value @@ -42,6 +51,16 @@ class Status : public Interface * @return - Updated value of the property */ bool occActive(bool value) override; + + private: + /** @brief OCC dbus object path */ + std::string path; + + /** @brief occ name prefix */ + std::string name = OCC_NAME; + + /** @brief OCC device object to do bind and unbind */ + Device device; }; } // namespace occ |