From e73446e30576ad6dc734398ad2ca709f2263ad51 Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Mon, 10 Apr 2017 13:55:52 -0500 Subject: Fan control: Add phosphor-fan-control framework Change-Id: Ie1dc082490997712b4fe3f42d0ddb5049ae5ca06 Signed-off-by: Matt Spinler --- .gitignore | 1 + Makefile.am | 2 ++ configure.ac | 2 +- control/Makefile.am | 11 +++++++++++ control/main.cpp | 29 +++++++++++++++++++++++++++++ 5 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 control/Makefile.am create mode 100644 control/main.cpp diff --git a/.gitignore b/.gitignore index 5390726..f3d36e5 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ stamp-h1 *.o fan_detect_defs.cpp phosphor-fan-presence-tach +phosphor-fan-control diff --git a/Makefile.am b/Makefile.am index 30223d0..6180d1e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,3 +21,5 @@ CLEANFILES = fan_detect_defs.cpp fan_detect_defs.cpp: ${srcdir}/gen-fan-detect-defs.py $(AM_V_GEN)$(GEN_FAN_DETECT_DEFS) > $@ + +SUBDIRS = control \ No newline at end of file diff --git a/configure.ac b/configure.ac index d5659f3..2c083ca 100644 --- a/configure.ac +++ b/configure.ac @@ -42,5 +42,5 @@ AC_DEFINE_UNQUOTED([FAN_DETECT_YAML_FILE], ["$FAN_DETECT_YAML_FILE"], # Create configured output AC_SUBST([GEN_FAN_DETECT_DEFS], [$PYTHON ${srcdir}/gen-fan-detect-defs.py -y $FAN_DETECT_YAML_FILE]) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile control/Makefile]) AC_OUTPUT diff --git a/control/Makefile.am b/control/Makefile.am new file mode 100644 index 0000000..a9b8133 --- /dev/null +++ b/control/Makefile.am @@ -0,0 +1,11 @@ +AM_DEFAULT_SOURCE_EXT = .cpp +AM_CPPFLAGS = -I${top_src_dir} + +sbin_PROGRAMS = \ + phosphor-fan-control + +phosphor_fan_control_SOURCES = \ + main.cpp + +phosphor_fan_control_LDFLAGS = $(SDBUSPLUS_LIBS) $(PHOSPHOR_LOGGING_LIBS) +phosphor_fan_control_CXXFLAGS = $(SDBUSPLUS_CFLAGS) $(PHOSPHOR_LOGGING_CFLAGS) diff --git a/control/main.cpp b/control/main.cpp new file mode 100644 index 0000000..e332dda --- /dev/null +++ b/control/main.cpp @@ -0,0 +1,29 @@ +/** + * 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 + +int main(int argc, char* argv[]) +{ + auto bus = sdbusplus::bus::new_default(); + + while (true) + { + bus.process_discard(); + bus.wait(); + } + + return 0; +} -- cgit v1.2.1