summaryrefslogtreecommitdiffstats
path: root/sensorhandler.cpp
diff options
context:
space:
mode:
authorBrandon Kim <brandonkim@google.com>2019-06-19 12:05:08 -0700
committerTom Joseph <tomjoseph@in.ibm.com>2019-08-12 05:32:48 +0000
commit9cf85627cf6fe224b7bf9399a60022397ebeb970 (patch)
tree5ac7c5adb8e57ddc5cf23dc114a649bde51bb311 /sensorhandler.cpp
parent24c771c85a4955320ef1803f0ded1c2852605bb0 (diff)
downloadphosphor-host-ipmid-9cf85627cf6fe224b7bf9399a60022397ebeb970.tar.gz
phosphor-host-ipmid-9cf85627cf6fe224b7bf9399a60022397ebeb970.zip
sensordatahandler: Throw on sensor's OperationalStatus
Add UPDATE_FUNCTIONAL_ON_FAIL and only when defined, read sensor's OperationalStatus interface for the functional property and throw if the sensor is not funcitonal. Bug: openbmc/phosphor-hwmon#10 Signed-off-by: Brandon Kim <brandonkim@google.com> Change-Id: I1144a6d3f8145bda73f3363664ca48b848a295db
Diffstat (limited to 'sensorhandler.cpp')
-rw-r--r--sensorhandler.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index d67e7f5..b321e96 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include "sensorhandler.hpp"
#include "fruread.hpp"
@@ -420,6 +422,12 @@ ipmi_ret_t ipmi_sen_get_sensor_reading(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
resp->operation = 1 << scanningEnabledBit;
return IPMI_CC_OK;
}
+#ifdef UPDATE_FUNCTIONAL_ON_FAIL
+ catch (const SensorFunctionalError& e)
+ {
+ return IPMI_CC_RESPONSE_ERROR;
+ }
+#endif
catch (const std::exception& e)
{
*data_len = getResponse.size();
OpenPOWER on IntegriCloud