summaryrefslogtreecommitdiffstats
path: root/monitor
diff options
context:
space:
mode:
Diffstat (limited to 'monitor')
-rw-r--r--monitor/Makefile.am1
-rw-r--r--monitor/fan_defs.hpp6
-rw-r--r--monitor/generated.cpp54
-rw-r--r--monitor/types.hpp33
4 files changed, 94 insertions, 0 deletions
diff --git a/monitor/Makefile.am b/monitor/Makefile.am
index 44458bd..ceec3dd 100644
--- a/monitor/Makefile.am
+++ b/monitor/Makefile.am
@@ -5,6 +5,7 @@ sbin_PROGRAMS = \
phosphor-fan-monitor
phosphor_fan_monitor_SOURCES = \
+ generated.cpp \
main.cpp
phosphor_fan_monitor_LDADD = \
diff --git a/monitor/fan_defs.hpp b/monitor/fan_defs.hpp
new file mode 100644
index 0000000..2cfd44a
--- /dev/null
+++ b/monitor/fan_defs.hpp
@@ -0,0 +1,6 @@
+#pragma once
+
+#include "types.hpp"
+
+extern const std::vector<phosphor::fan::monitor::FanDefinition>
+fanDefinitions;
diff --git a/monitor/generated.cpp b/monitor/generated.cpp
new file mode 100644
index 0000000..7578b92
--- /dev/null
+++ b/monitor/generated.cpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright © 2017 IBM Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "fan_defs.hpp"
+#include "types.hpp"
+
+//This file will be replaced by a generated version in a later commit
+
+using namespace phosphor::fan::monitor;
+
+const std::vector<FanDefinition> fanDefinitions
+{
+
+ FanDefinition{"/system/chassis/motherboard/fan0",
+ 15,
+ 15,
+ 1,
+ std::vector<SensorDefinition>{
+ SensorDefinition{"fan0", true}
+ }},
+ FanDefinition{"/system/chassis/motherboard/fan1",
+ 15,
+ 15,
+ 1,
+ std::vector<SensorDefinition>{
+ SensorDefinition{"fan1", true}
+ }},
+ FanDefinition{"/system/chassis/motherboard/fan2",
+ 15,
+ 15,
+ 1,
+ std::vector<SensorDefinition>{
+ SensorDefinition{"fan2", true}
+ }},
+ FanDefinition{"/system/chassis/motherboard/fan3",
+ 15,
+ 15,
+ 1,
+ std::vector<SensorDefinition>{
+ SensorDefinition{"fan3", true}
+ }}
+};
diff --git a/monitor/types.hpp b/monitor/types.hpp
new file mode 100644
index 0000000..dbdebd9
--- /dev/null
+++ b/monitor/types.hpp
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <string>
+#include <tuple>
+#include <vector>
+
+namespace phosphor
+{
+namespace fan
+{
+namespace monitor
+{
+
+constexpr auto sensorNameField = 0;
+constexpr auto hasTargetField = 1;
+
+using SensorDefinition = std::tuple<std::string, bool>;
+
+constexpr auto fanNameField = 0;
+constexpr auto timeoutField = 1;
+constexpr auto fanDeviationField = 2;
+constexpr auto numSensorFailsForNonfuncField = 3;
+constexpr auto sensorListField = 4;
+
+using FanDefinition = std::tuple<std::string,
+ size_t,
+ size_t,
+ size_t,
+ std::vector<SensorDefinition>>;
+
+}
+}
+}
OpenPOWER on IntegriCloud