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>
diff --git a/occ_status.cpp b/occ_status.cpp
index a78ea47..ca8a1f9 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -7,6 +7,19 @@
// Handles updates to occActive property
bool Status::occActive(bool value)
{
+ if (value != this->occActive())
+ {
+ if (value)
+ {
+ // Bind the device
+ device.bind();
+ }
+ else
+ {
+ // Do the unbind
+ device.unBind();
+ }
+ }
return Base::Status::occActive(value);
}