Robin Mueller
371ff931bf
The CommandExecutor helper class can execute shell commands in blocking and non-blocking mode This class is able to execute processes by using the Linux popen call. It also has the capability of writing the read output of a process into a provided ring buffer. The executor works by first loading the command which should be executed and specifying whether it should be executed blocking or non-blocking. After that, execution can be started with the execute call. Using non-blocking mode allows to execute commands which might take a longer time in the background, and allowing the user thread to check completion status with the check function Moved to HAL like requested in code review and unit tested with failing commands as well. Also, Linux HAL components are compiled by default now unless explicitely disabled.
17 lines
553 B
CMake
17 lines
553 B
CMake
# This abstraction layer requires the gpiod library. You can install this library
|
|
# with "sudo apt-get install -y libgpiod-dev". If you are cross-compiling, you need
|
|
# to install the package before syncing the sysroot to your host computer.
|
|
find_library(LIB_GPIO gpiod)
|
|
|
|
if(${LIB_GPIO} MATCHES LIB_GPIO-NOTFOUND)
|
|
message(STATUS "gpiod library not found, not linking against it")
|
|
else()
|
|
target_sources(${LIB_FSFW_NAME} PRIVATE
|
|
LinuxLibgpioIF.cpp
|
|
)
|
|
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
|
|
${LIB_GPIO}
|
|
)
|
|
endif()
|
|
|