From b57f151092ae04ca2849851ac406624b87666e8c Mon Sep 17 00:00:00 2001 From: Vishwanatha Subbanna Date: Mon, 4 Sep 2017 15:06:20 +0530 Subject: Set OccActive property on application start Host sends OCC active status command just once as part of power on operation and when that is sent, occ control application binds the device. As part of bind, a sysfs file gets created that would be used to communicate the occ error status back to user. If occ control application terminates and restarts, then it needs some way to set OccActive property and this commit adds that support. Solution is to check if the device is already bound by checking the presence of the OCC_HWMON_PATH/occ-dev0 and set the property if found Fixes openbmc/openbmc#2238 Change-Id: I920b52e3970cc91af50b5bc68ead44c66eab8944 Signed-off-by: Vishwanatha Subbanna --- occ_status.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'occ_status.hpp') diff --git a/occ_status.hpp b/occ_status.hpp index c097908..a334a2b 100644 --- a/occ_status.hpp +++ b/occ_status.hpp @@ -55,7 +55,7 @@ class Status : public Interface EventPtr& event, const char* path, std::function callBack = nullptr) - : Interface(bus, path), + : Interface(bus, path, true), bus(bus), path(path), callBack(callBack), @@ -78,7 +78,14 @@ class Status : public Interface std::bind(std::mem_fn(&Status::hostControlEvent), this, std::placeholders::_1)) { - // Nothing to do here + // Check to see if we have OCC already bound. If so, just set it + if (device.bound()) + { + this->occActive(true); + } + + // Announce that we are ready + this->emit_object_added(); } /** @brief Since we are overriding the setter-occActive but not the -- cgit v1.2.1