functions: bios-attr: Add match for PLDM
Add a match to watch for PLDM name owner change to detect when PLDM
starts. The callback would check if the new owner is set, which means
the service started instead of stopped, and then gets the properties
from entity manager to call the function that parse the json file and
sets the bios attr. If the entity manager interfaces are empty, it just
returns and the entity manager callback would take over when entity
manager starts.
This bios attr subcommand is now a vector to be able to return the two
matches, the one for EM and the new PLDM one.
Tested: Verify the bios attr was set when EM and PLDM were stopped and
EM was started then PLDM, and also having PLDM start first then EM.
Change-Id: I75fe1aae8084191226a8bd3b69087ca39ae2a43f
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/item_updater_main.cpp b/item_updater_main.cpp
index c6a8175..556e03d 100644
--- a/item_updater_main.cpp
+++ b/item_updater_main.cpp
@@ -92,10 +92,14 @@
"firmware data details.")
->callback([&bus, &loop, &subcommandContext, extensionMap]() {
auto elementsJsonFilePath = "/usr/share/hostfw/elements.json"s;
- subcommandContext.push_back(
+ auto subcommands =
functions::process_hostfirmware::updateBiosAttrTable(
bus, extensionMap, std::move(elementsJsonFilePath),
- loop));
+ loop);
+ for (const auto& subcommand : subcommands)
+ {
+ subcommandContext.push_back(subcommand);
+ }
}));
CLI11_PARSE(app, argc, argv);