Add D-Bus Raw PECI Daemon
This adds a new D-Bus daemon to handle raw PECI requests over
D-Bus.
The D-Bus interface provides a Send method that takes a
vector of byte vectors where each byte vector contains the raw
data for a single PECI command. This allows sending an array
of raw PECI commands to execute in bulk to avoid issues with
network latency when sending multiple commands.
The method returns a vector of raw PECI responses corresponding
to the vector of raw commands.
Tested:
Confirmed that a single and multiple PECI commands correctly
execute and return when SendRawPeci is called.
Change-Id: I6b2d0f81366ea77057e70d69c72be90ba4c4aeb9
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 441b320..398f396 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,8 @@
target_include_directories(peci PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(peci PROPERTIES VERSION "1.0" SOVERSION "1")
+option(DBUS_RAW_PECI "Add the raw PECI D-Bus daemon to the build." OFF)
+
set(
CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} \
@@ -38,3 +40,28 @@
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static)
+
+if(${DBUS_RAW_PECI})
+ add_executable(raw-peci dbus_raw_peci.cpp)
+ add_dependencies(raw-peci peci)
+
+ find_package(Boost 1.73 REQUIRED)
+ include_directories(${BOOST_SRC_DIR})
+
+ add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY)
+ add_definitions(-DBOOST_SYSTEM_NO_DEPRECATED)
+ add_definitions(-DBOOST_ALL_NO_LIB)
+ add_definitions(-DBOOST_NO_RTTI)
+ add_definitions(-DBOOST_NO_TYPEID)
+
+ target_link_libraries(raw-peci peci -lsystemd sdbusplus)
+
+ install(TARGETS raw-peci
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib/static)
+
+ set(SERVICE_FILES ${PROJECT_SOURCE_DIR}/service_files/com.intel.peci.service)
+
+ install(FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)
+endif()
\ No newline at end of file