convert sysfs gpio usage to libgpiod
Updated Chassis Intrusion Sensor monitoring
to use pin name and gpiod APIs. Number based sysfs
framework is deprecated and replaced by descriptor
based gpiod framework. With named gpio pin,
code is more portable provided the device tree
defines GPIO pin name consistently.
This requires device tree change (227661) and
configuration file change (entity-manager/+/28350)
Tested:
Build and run changes together and verified chassis intrusion sensor
value gets updated correctly through D-Bus object.
Signed-off-by: ZhikuiRen <zhikui.ren@intel.com>
Change-Id: I03c50e32059936902432d5a8bc498dabb812ea5e
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 645a1a8..f9d6d31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -181,6 +181,7 @@
add_dependencies (intrusionsensor sdbusplus-project)
target_link_libraries (intrusionsensor ${SENSOR_LINK_LIBS})
target_link_libraries (intrusionsensor i2c)
+target_link_libraries (intrusionsensor gpiodcxx)
add_executable (ipmbsensor src/IpmbSensor.cpp ${IPMB_SRC_FILES})
add_dependencies (ipmbsensor sdbusplus-project)