aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--apps/CMakeLists.txt11
-rw-r--r--apps/sample-convert.cpp2
-rw-r--r--apps/sample-select.cpp2
-rw-r--r--apps/sample-timestamp.cpp2
-rw-r--r--apps/sm-get-value.cpp2
-rw-r--r--apps/sm-serial-read-all.cpp2
-rw-r--r--apps/sm-serial-read.cpp2
-rw-r--r--sensor/CMakeLists.txt8
-rw-r--r--sensor/include/SensorSample.h (renamed from apps/SoilMoistureIo.h)0
-rw-r--r--sensor/main/SensorSample.cpp (renamed from apps/SoilMoistureIo.cpp)2
-rw-r--r--sensor/test/SoilMoistureIoTest.cpp (renamed from test/SoilMoistureIoTest.cpp)2
12 files changed, 23 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0d48449..9da7eb6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,5 +42,6 @@ endif(DOXYGEN_FOUND)
add_subdirectory(ble)
add_subdirectory(apps)
+add_subdirectory(sensor)
add_subdirectory(test)
enable_testing()
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
index 3891d79..15a1f0b 100644
--- a/apps/CMakeLists.txt
+++ b/apps/CMakeLists.txt
@@ -11,7 +11,6 @@ list(APPEND APPS sm-serial-read-all)
add_library(trygvis-apps
SoilMoisture.cpp
- SoilMoistureIo.cpp
apps.cpp)
# Boost
@@ -35,18 +34,20 @@ if(LOG4CPLUS_LIBRARIES MATCHES NOTFOUND)
message(FATAL_ERROR "Could not find log4cplus library files")
endif()
-foreach(app ${APPS})
- include_directories("${PROJECT_SOURCE_DIR}/include")
- include_directories("${PROJECT_SOURCE_DIR}/json/src")
+include_directories("${PROJECT_SOURCE_DIR}/include")
+include_directories("${PROJECT_SOURCE_DIR}/json/src")
+include_directories("${PROJECT_SOURCE_DIR}/sensor/include")
+include_directories("${LOG4CPLUS_INCLUDE_DIRECTORIES}")
+foreach(app ${APPS})
add_executable(${app} ${app}.cpp)
target_link_libraries(${app} ble)
target_link_libraries(${app} trygvis-apps)
+ target_link_libraries(${app} trygvis-sensor)
target_link_libraries(${app} ${Boost_LIBRARIES})
target_link_libraries(${app} ${BLUEZ_LIBRARIES})
target_link_libraries(${app} ${PQXX_LIBRARIES})
- include_directories("${LOG4CPLUS_INCLUDE_DIRECTORIES}")
target_link_libraries(${app} ${LOG4CPLUS_LIBRARIES})
target_link_libraries(${app} ${CMAKE_THREAD_LIBS_INIT})
endforeach(app)
diff --git a/apps/sample-convert.cpp b/apps/sample-convert.cpp
index 9e2ad55..4834732 100644
--- a/apps/sample-convert.cpp
+++ b/apps/sample-convert.cpp
@@ -1,4 +1,4 @@
-#include "SoilMoistureIo.h"
+#include "SensorSample.h"
#include "json.hpp"
#include "apps.h"
#include <fstream>
diff --git a/apps/sample-select.cpp b/apps/sample-select.cpp
index d1954b3..8180709 100644
--- a/apps/sample-select.cpp
+++ b/apps/sample-select.cpp
@@ -1,4 +1,4 @@
-#include "SoilMoistureIo.h"
+#include "SensorSample.h"
#include "apps.h"
#include <boost/tokenizer.hpp>
diff --git a/apps/sample-timestamp.cpp b/apps/sample-timestamp.cpp
index 0242021..018ecb0 100644
--- a/apps/sample-timestamp.cpp
+++ b/apps/sample-timestamp.cpp
@@ -1,4 +1,4 @@
-#include "SoilMoistureIo.h"
+#include "SensorSample.h"
#include "apps.h"
#include <fstream>
#include <sys/stat.h>
diff --git a/apps/sm-get-value.cpp b/apps/sm-get-value.cpp
index 9f9308a..b8fa983 100644
--- a/apps/sm-get-value.cpp
+++ b/apps/sm-get-value.cpp
@@ -5,7 +5,7 @@
#include <thread>
#include "ble/Bluetooth.h"
#include "SoilMoisture.h"
-#include "SoilMoistureIo.h"
+#include "SensorSample.h"
#include "json.hpp"
#include "apps.h"
diff --git a/apps/sm-serial-read-all.cpp b/apps/sm-serial-read-all.cpp
index 8050c85..7241864 100644
--- a/apps/sm-serial-read-all.cpp
+++ b/apps/sm-serial-read-all.cpp
@@ -1,4 +1,4 @@
-#include "SoilMoistureIo.h"
+#include "SensorSample.h"
#include "json.hpp"
#include "apps.h"
#include <thread>
diff --git a/apps/sm-serial-read.cpp b/apps/sm-serial-read.cpp
index 4edd940..a8d528a 100644
--- a/apps/sm-serial-read.cpp
+++ b/apps/sm-serial-read.cpp
@@ -1,4 +1,4 @@
-#include "SoilMoistureIo.h"
+#include "SensorSample.h"
#include "json.hpp"
#include "apps.h"
#include <chrono>
diff --git a/sensor/CMakeLists.txt b/sensor/CMakeLists.txt
new file mode 100644
index 0000000..5d7612f
--- /dev/null
+++ b/sensor/CMakeLists.txt
@@ -0,0 +1,8 @@
+add_library(trygvis-sensor
+ main/SensorSample.cpp)
+
+include_directories("${PROJECT_SOURCE_DIR}/json/src")
+include_directories(include)
+
+# Boost
+find_package(Boost COMPONENTS regex system program_options REQUIRED)
diff --git a/apps/SoilMoistureIo.h b/sensor/include/SensorSample.h
index 386296a..386296a 100644
--- a/apps/SoilMoistureIo.h
+++ b/sensor/include/SensorSample.h
diff --git a/apps/SoilMoistureIo.cpp b/sensor/main/SensorSample.cpp
index 1d9281b..6ec6dfc 100644
--- a/apps/SoilMoistureIo.cpp
+++ b/sensor/main/SensorSample.cpp
@@ -1,4 +1,4 @@
-#include "SoilMoistureIo.h"
+#include "SensorSample.h"
#include "json.hpp"
#include <set>
diff --git a/test/SoilMoistureIoTest.cpp b/sensor/test/SoilMoistureIoTest.cpp
index e7889d0..574885c 100644
--- a/test/SoilMoistureIoTest.cpp
+++ b/sensor/test/SoilMoistureIoTest.cpp
@@ -1,4 +1,4 @@
-#include "SoilMoistureIo.h"
+#include "SensorSample.h"
#define BOOST_TEST_MODULE "SoilMoistureIoTest"