xref: /openbmc/pldm/fw-update/firmware_inventory.cpp (revision ee2bd8ad3979dac8c41afa643e0eb24b31e70683)
1 #include "firmware_inventory.hpp"
2 
3 namespace pldm::fw_update
4 {
5 
FirmwareInventory(SoftwareIdentifier,const std::string & softwarePath,const std::string & softwareVersion,const std::string & associatedEndpoint,SoftwareVersionPurpose purpose)6 FirmwareInventory::FirmwareInventory(
7     SoftwareIdentifier /*softwareIdentifier*/, const std::string& softwarePath,
8     const std::string& softwareVersion, const std::string& associatedEndpoint,
9     SoftwareVersionPurpose purpose) :
10     softwarePath(softwarePath),
11     association(this->bus, this->softwarePath.c_str()),
12     version(this->bus, this->softwarePath.c_str(),
13             SoftwareVersion::action::defer_emit)
14 {
15     this->association.associations(
16         {{"running", "ran_on", associatedEndpoint.c_str()}});
17     this->version.version(softwareVersion.c_str());
18     this->version.purpose(purpose);
19     this->version.emit_added();
20 }
21 
22 } // namespace pldm::fw_update
23