Tony Lee | 6c59501 | 2019-06-19 10:54:59 +0800 | [diff] [blame] | 1 | #include "nvmes.hpp" |
| 2 | |
| 3 | namespace phosphor |
| 4 | { |
| 5 | namespace nvme |
| 6 | { |
| 7 | |
| 8 | void NvmeSSD::checkSensorThreshold() |
| 9 | { |
| 10 | int8_t value = ValueIface::value(); |
| 11 | int8_t criticalHigh = CriticalInterface::criticalHigh(); |
| 12 | int8_t criticalLow = CriticalInterface::criticalLow(); |
| 13 | int8_t warningHigh = WarningInterface::warningHigh(); |
| 14 | int8_t warningLow = WarningInterface::warningLow(); |
| 15 | |
| 16 | CriticalInterface::criticalAlarmHigh(value > criticalHigh); |
| 17 | |
| 18 | CriticalInterface::criticalAlarmLow(value < criticalLow); |
| 19 | |
| 20 | WarningInterface::warningAlarmHigh(value > warningHigh); |
| 21 | |
| 22 | WarningInterface::warningAlarmLow(value < warningLow); |
| 23 | } |
| 24 | |
| 25 | void NvmeSSD::setSensorThreshold(int8_t criticalHigh, int8_t criticalLow, |
| 26 | int8_t maxValue, int8_t minValue, |
| 27 | int8_t warningHigh, int8_t warningLow) |
| 28 | { |
| 29 | |
| 30 | CriticalInterface::criticalHigh(criticalHigh); |
| 31 | CriticalInterface::criticalLow(criticalLow); |
| 32 | |
| 33 | WarningInterface::warningHigh(warningHigh); |
| 34 | WarningInterface::warningLow(warningLow); |
| 35 | |
| 36 | ValueIface::maxValue(maxValue); |
| 37 | ValueIface::minValue(minValue); |
| 38 | } |
| 39 | |
| 40 | void NvmeSSD::setSensorValueToDbus(const int8_t value) |
| 41 | { |
| 42 | ValueIface::value(value); |
| 43 | } |
| 44 | |
| 45 | } // namespace nvme |
| 46 | } // namespace phosphor |