diff options
author | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-06-29 18:35:00 +0530 |
---|---|---|
committer | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-07-29 23:57:59 +0530 |
commit | ee4d83dfc7b6cf3b5979541ab5b1918b68e6bbdb (patch) | |
tree | 4d186ddf133d77880e857fccdddb71fcc155a6bf /occ_status.cpp | |
parent | 554d60059e7d0b699b3cdcbe8de2c341613e9931 (diff) | |
download | openpower-occ-control-ee4d83dfc7b6cf3b5979541ab5b1918b68e6bbdb.tar.gz openpower-occ-control-ee4d83dfc7b6cf3b5979541ab5b1918b68e6bbdb.zip |
Add support to watch for OCC errors
Change-Id: I98d95020a2d01e281e5c8efa825d6b4bd4c6c160
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'occ_status.cpp')
-rw-r--r-- | occ_status.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
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 @@ bool Status::occActive(bool value) { // 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 |