Modify presence detect
Presence is detected using the presence information in the json
for FRUs.
Since a FRU could be hot-pluggable, we need a mechanism to
identify this nature and use polling in such cases.
So added pollingRequired key in the json and using this key to
detect whether polling required or not for this FRU.
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
Change-Id: I7c3db33501f2c442e8e8e1161c77feadfcbc0dab
diff --git a/vpd-manager/gpioMonitor.cpp b/vpd-manager/gpioMonitor.cpp
index b57d52c..960b9b4 100644
--- a/vpd-manager/gpioMonitor.cpp
+++ b/vpd-manager/gpioMonitor.cpp
@@ -60,6 +60,12 @@
if ((eachInventory.find("presence") != eachInventory.end()) &&
(eachInventory.find("preAction") != eachInventory.end()))
{
+ if (!eachInventory["presence"].value("pollingRequired", false))
+ {
+ // Polling not required for this FRU , skip.
+ continue;
+ }
+
for (const auto& presStatus : eachInventory["presence"].items())
{
if (presStatus.key() == "pin")