Add support to watch for OCC errors
Change-Id: I98d95020a2d01e281e5c8efa825d6b4bd4c6c160
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/occ_status.cpp b/occ_status.cpp
index ca8a1f9..83825c5 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -13,15 +13,28 @@
{
// Bind the device
device.bind();
+
+ // And watch for errors
+ device.addErrorWatch();
}
else
{
- // Do the unbind
+ // Stop watching for errors
+ device.removeErrorWatch();
+
+ // Do the unbind.
device.unBind();
}
}
return Base::Status::occActive(value);
}
+// Callback handler when a device error is reported.
+void Status::deviceErrorHandler()
+{
+ // This would deem OCC inactive
+ this->occActive(false);
+}
+
} // namespace occ
} // namespace open_power