veliad: Instantiate IETFHardware and Sysrepo callback
Instantiate Sysrepo class and IETFHardware in the veliad daemon. We also
created a Factory class for initializing hardware state data readers
(e.g. specifically for czechlight clearfog boards).
There is also a possibility to split veliad daemon into two. First daemon
would handle the "health" part and second daemon would be just a simple
Sysrepo operational data callback for the IETF Hardware part. However,
we then discussed the future of the daemon and we'd like the outputs to
reflect the current IETF Hardware state (i.e., temperatures are going
crazy, show red light). However, if this was split among two daemons it
would require some IPC to be implemented.
Having everything in one daemon would simplify things and does not bring
much complexity to veliad.
Change-Id: Ifde2cd92eace447959c68684a879771aaf2e45ea
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a92030d..184ca55 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -89,17 +89,6 @@
${STD_FILESYSTEM_LIBRARY}
)
-add_executable(veliad
- src/main.cpp
- )
-target_link_libraries(veliad
- PUBLIC
- velia-health
- docopt
- )
-add_dependencies(veliad target-VELIA_VERSION)
-target_include_directories(veliad PUBLIC ${CMAKE_BINARY_DIR})
-
# - ietf-hardware
add_library(velia-ietf-hardware STATIC
src/ietf-hardware/sysfs/EMMC.cpp
@@ -131,6 +120,22 @@
)
target_include_directories(velia-ietf-hardware PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/velia-hardware)
+# - daemon
+add_executable(veliad
+ src/main.cpp
+ src/Factory.cpp
+ src/Factory.h
+ )
+target_link_libraries(veliad
+ PUBLIC
+ velia-health
+ velia-ietf-hardware
+ velia-ietf-hardware-sysrepo
+ docopt
+ )
+add_dependencies(veliad target-VELIA_VERSION)
+target_include_directories(veliad PUBLIC ${CMAKE_BINARY_DIR})
+
# Testing
include(CTest)
if(BUILD_TESTING)