Add basic function for phosphor-nvme.

Add basic function to monitor temperature of
NVMe drive for phosphor-nvme.

Change-Id: Iebe3c8bf4b5cb958defab5b24a88f4bce477ad5e
Signed-off-by: Tony Lee <tony.lee@quantatw.com>
diff --git a/nvmes.cpp b/nvmes.cpp
new file mode 100644
index 0000000..01222d0
--- /dev/null
+++ b/nvmes.cpp
@@ -0,0 +1,46 @@
+#include "nvmes.hpp"
+
+namespace phosphor
+{
+namespace nvme
+{
+
+void NvmeSSD::checkSensorThreshold()
+{
+    int8_t value = ValueIface::value();
+    int8_t criticalHigh = CriticalInterface::criticalHigh();
+    int8_t criticalLow = CriticalInterface::criticalLow();
+    int8_t warningHigh = WarningInterface::warningHigh();
+    int8_t warningLow = WarningInterface::warningLow();
+
+    CriticalInterface::criticalAlarmHigh(value > criticalHigh);
+
+    CriticalInterface::criticalAlarmLow(value < criticalLow);
+
+    WarningInterface::warningAlarmHigh(value > warningHigh);
+
+    WarningInterface::warningAlarmLow(value < warningLow);
+}
+
+void NvmeSSD::setSensorThreshold(int8_t criticalHigh, int8_t criticalLow,
+                                 int8_t maxValue, int8_t minValue,
+                                 int8_t warningHigh, int8_t warningLow)
+{
+
+    CriticalInterface::criticalHigh(criticalHigh);
+    CriticalInterface::criticalLow(criticalLow);
+
+    WarningInterface::warningHigh(warningHigh);
+    WarningInterface::warningLow(warningLow);
+
+    ValueIface::maxValue(maxValue);
+    ValueIface::minValue(minValue);
+}
+
+void NvmeSSD::setSensorValueToDbus(const int8_t value)
+{
+    ValueIface::value(value);
+}
+
+} // namespace nvme
+} // namespace phosphor
\ No newline at end of file