Update inventory with latest presence state
Inventory is attempted to be updated with the current presence state,
which is determined from all of the fan's sensor readings.
Change-Id: Ic869cf5e5fdeada8d07b3deeabf347e40da3d8ba
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/fan_enclosure.cpp b/fan_enclosure.cpp
index 2bed251..b2ea9f7 100644
--- a/fan_enclosure.cpp
+++ b/fan_enclosure.cpp
@@ -70,7 +70,17 @@
ObjectMap invObj = getObjectMap();
//Get inventory manager service name from mapper
std::string invService = getInvService();
- //TODO Update inventory for this fan
+ // Update inventory for this fan
+ auto invMsg = bus.new_method_call(invService.c_str(),
+ INVENTORY_PATH,
+ INVENTORY_INTF,
+ "Notify");
+ invMsg.append(std::move(invObj));
+ auto invMgrResponseMsg = bus.call(invMsg);
+ if (invMgrResponseMsg.is_method_error())
+ {
+ //TODO Handle error in notify call
+ }
}
void FanEnclosure::addSensor(