Support size_t properties on extraInterfaces
The xyz...I2CDevice interface is needed on certain FRU object paths so
that entity-manager can know the EEPROM I2C bus and address. It has two
size_t properties, Bus and Address.
This commit adds support for this by looking for numeric JSON properties
in the extraInterfaces JSON and saving them in the PIM payload as
size_t.
A future improvement would be to figure out the exact type needed, such
as uint64_t, int, etc.
Tested: Saw the interface on D-Bus:
xyz.openbmc_project.Inventory.Decorator.I2CDevice
.Address 81
.Bus 30
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Iad92917b53e0dc9fdc7cd95d7452e41a8a7f6510
diff --git a/ibm_vpd_app.cpp b/ibm_vpd_app.cpp
index c6e58e6..adf68f0 100644
--- a/ibm_vpd_app.cpp
+++ b/ibm_vpd_app.cpp
@@ -311,6 +311,12 @@
}
}
}
+ else if (itr.value().is_number())
+ {
+ // For now assume the value is a size_t. In the future it would
+ // be nice to come up with a way to get the type from the JSON.
+ props.emplace(busProp, itr.value().get<size_t>());
+ }
}
interfaces.emplace(inf, move(props));
}