Add Softshutdown and Hardshutdown threshold interface
Added threshold interfaces like Softshutdown and Hardshutdown
interfaces in dbus-sensors. This is similiar to warning and
critical threshold interfaces.
To enable this Softshutdown and Hardshutdown interfaces, need to
set the Severity level in EM config. Severity value as 2 for
Softshutdown and Severity value as 3 for Hardshutdown.
TESTED: Tested on Facebook YosemiteV2 hardware. Verified the
Hardshutdown and Softshutdown interfaces are created
and displaying in dbus objects.
Signed-off-by: Jayashree Dhanapal <jayashree-d@hcl.com>
Change-Id: Ic9a6e719a8343321f894bc031688a17a3ed7fd67
diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp
index bc6bb84..e186acb 100644
--- a/src/Thresholds.cpp
+++ b/src/Thresholds.cpp
@@ -17,7 +17,6 @@
#include <vector>
static constexpr bool debug = false;
-static constexpr int thresLevel = 2;
namespace thresholds
{
Level findThresholdLevel(uint8_t sev, const std::string& direct)
@@ -127,8 +126,7 @@
Level level = findThresholdLevel(severity, directions);
Direction direction = findThresholdDirection(severity, directions);
- if ((static_cast<int>(level) == thresLevel) ||
- (static_cast<int>(direction) == thresLevel))
+ if ((level == Level::ERROR) || (direction == Direction::ERROR))
{
continue;
}
@@ -564,6 +562,12 @@
case Level::CRITICAL:
level = "Critical";
break;
+ case Level::SOFTSHUTDOWN:
+ level = "SoftShutDown";
+ break;
+ case Level::HARDSHUTDOWN:
+ level = "HardShutdown";
+ break;
case Level::ERROR:
level = "Error";
break;