summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Wyman <bjwyman@gmail.com>2017-03-29 17:06:02 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-04-24 23:26:30 -0400
commitca60e10f1abd7c3d05e6a2aff62ee56e46c9debc (patch)
treea01e1d30748251596e13d06ce579526f636c3056
parent93919bbdd76cd62829b4772923f998e76d871b4c (diff)
downloadphosphor-fan-presence-ca60e10f1abd7c3d05e6a2aff62ee56e46c9debc.tar.gz
phosphor-fan-presence-ca60e10f1abd7c3d05e6a2aff62ee56e46c9debc.zip
Create framework for phosphor-cooling-type app
An application called phosphor-cooling-type is being created in the phosphor-fan-presence repo under the chassis-cooling-type subdirectory. This application will update the D-Bus CoolingType properties for a cooling zone via passed in parameters. The current properties to be updated are AirCooling and WaterCooling. They will be set to true or false based the passed in parameters --air (set AirCooling to true), --water (set WaterCooling to true), and/or --gpio=<path> (path to a GPIO pin to read to determine if one or more properties should be set to true or false). Change-Id: I774065e29849aaa54653ae6188dc42aa846a1cf0 Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
-rw-r--r--Makefile.am3
-rw-r--r--chassis-cooling-type/Makefile.am8
-rw-r--r--chassis-cooling-type/cooling_type.cpp10
-rw-r--r--chassis-cooling-type/cooling_type.hpp12
-rw-r--r--configure.ac9
5 files changed, 42 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 9baa62b..7b34537 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,3 +17,6 @@ endif
if WANT_CONTROL
SUBDIRS += control
endif
+if WANT_COOLING_TYPE
+SUBDIRS += chassis-cooling-type
+endif
diff --git a/chassis-cooling-type/Makefile.am b/chassis-cooling-type/Makefile.am
new file mode 100644
index 0000000..7a31d77
--- /dev/null
+++ b/chassis-cooling-type/Makefile.am
@@ -0,0 +1,8 @@
+AM_DEFAULT_SOURCE_EXT = .cpp
+
+sbin_PROGRAMS = \
+ phosphor-cooling-type
+
+phosphor_cooling_type_SOURCES = \
+ cooling_type.cpp
+
diff --git a/chassis-cooling-type/cooling_type.cpp b/chassis-cooling-type/cooling_type.cpp
new file mode 100644
index 0000000..d382a0b
--- /dev/null
+++ b/chassis-cooling-type/cooling_type.cpp
@@ -0,0 +1,10 @@
+#include "cooling_type.hpp"
+
+int main(int argc, char* argv[])
+{
+ int rc = -1;
+
+ rc = 0;
+
+ return rc;
+}
diff --git a/chassis-cooling-type/cooling_type.hpp b/chassis-cooling-type/cooling_type.hpp
new file mode 100644
index 0000000..ff9e34d
--- /dev/null
+++ b/chassis-cooling-type/cooling_type.hpp
@@ -0,0 +1,12 @@
+#pragma once
+
+namespace phosphor
+{
+namespace chassis
+{
+namespace cooling
+{
+
+}
+}
+}
diff --git a/configure.ac b/configure.ac
index e0c5300..12337c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,9 +34,12 @@ AC_ARG_ENABLE([presence],
AS_HELP_STRING([--disable-presence], [Disable fan presence package.]))
AC_ARG_ENABLE([control],
AS_HELP_STRING([--disable-control], [Disable fan control package.]))
+AC_ARG_ENABLE([cooling-type],
+ AS_HELP_STRING([--disable-cooling-type], [Disable cooling-type package.]))
AM_CONDITIONAL([WANT_PRESENCE], [test "x$enable_presence" != "xno"])
AM_CONDITIONAL([WANT_CONTROL], [test "x$enable_control" != "xno"])
+AM_CONDITIONAL([WANT_COOLING_TYPE], [test "x$enable_cooling-type" != "xno"])
# Package specific checks.
AS_IF([test "x$enable_presence" != "xno"], [
@@ -57,6 +60,12 @@ AS_IF([test "x$enable_control" != "xno"], [
AC_CONFIG_FILES([control/Makefile])
])
+AS_IF([test "x$enable_cooling-type" != "xno"], [
+ PKG_CHECK_MODULES([LIBEVDEV], [libevdev], ,
+ [AC_MSG_ERROR([The libevdev package is required])])
+ AC_CONFIG_FILES([chassis-cooling-type/Makefile])
+])
+
# Create configured output
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
OpenPOWER on IntegriCloud