All: add purpose parameter to setVersion calls
All calls to setVersion now include a purpose argument, changing the
purpose string from "unknown" to "other".
Change-Id: I201db1719333b51deead2dd99c9f637c782efd6c
Signed-off-by: Daniel Hsu <Daniel-Hsu@quantatw.com>
diff --git a/bios/bios_software_manager.cpp b/bios/bios_software_manager.cpp
index 0c4814f..b34ab3e 100644
--- a/bios/bios_software_manager.cpp
+++ b/bios/bios_software_manager.cpp
@@ -110,7 +110,8 @@
spiDevice->softwareCurrent = std::move(software);
- spiDevice->softwareCurrent->setVersion(SPIDevice::getVersion());
+ spiDevice->softwareCurrent->setVersion(
+ SPIDevice::getVersion(), SoftwareVersion::VersionPurpose::Host);
devices.insert({config.objectPath, std::move(spiDevice)});
diff --git a/bios/spi_device.cpp b/bios/spi_device.cpp
index 1af1e66..fb9f6a4 100644
--- a/bios/spi_device.cpp
+++ b/bios/spi_device.cpp
@@ -527,7 +527,8 @@
if (softwareCurrent)
{
- softwareCurrent->setVersion(getVersion());
+ softwareCurrent->setVersion(getVersion(),
+ SoftwareVersion::VersionPurpose::Host);
}
co_return;
diff --git a/cpld/cpld_software_manager.cpp b/cpld/cpld_software_manager.cpp
index 6303135..e4793b3 100644
--- a/cpld/cpld_software_manager.cpp
+++ b/cpld/cpld_software_manager.cpp
@@ -50,7 +50,7 @@
std::unique_ptr<Software> software = std::make_unique<Software>(ctx, *cpld);
- software->setVersion(version);
+ software->setVersion(version, SoftwareVersion::VersionPurpose::Other);
std::set<RequestedApplyTimes> allowedApplyTimes = {
RequestedApplyTimes::Immediate, RequestedApplyTimes::OnReset};
diff --git a/eeprom-device/eeprom_device.cpp b/eeprom-device/eeprom_device.cpp
index fbe65f3..41cfea2 100644
--- a/eeprom-device/eeprom_device.cpp
+++ b/eeprom-device/eeprom_device.cpp
@@ -398,7 +398,9 @@
std::string version = deviceVersion->getVersion();
if (!version.empty())
{
- softwareCurrent->setVersion(version);
+ softwareCurrent->setVersion(
+ version,
+ SoftwareInf::SoftwareVersion::VersionPurpose::Other);
}
}
}
diff --git a/eeprom-device/eeprom_device_software_manager.cpp b/eeprom-device/eeprom_device_software_manager.cpp
index 79b273e..32930cb 100644
--- a/eeprom-device/eeprom_device_software_manager.cpp
+++ b/eeprom-device/eeprom_device_software_manager.cpp
@@ -171,7 +171,8 @@
std::unique_ptr<SoftwareInf::Software> software =
std::make_unique<SoftwareInf::Software>(ctx, *eepromDevice);
- software->setVersion(version.empty() ? "Unknown" : version);
+ software->setVersion(version.empty() ? "Unknown" : version,
+ SoftwareInf::SoftwareVersion::VersionPurpose::Other);
std::set<RequestedApplyTimes> allowedApplyTimes = {
RequestedApplyTimes::Immediate, RequestedApplyTimes::OnReset};
diff --git a/i2c-vr/i2cvr_software_manager.cpp b/i2c-vr/i2cvr_software_manager.cpp
index f1df77b..29e198f 100644
--- a/i2c-vr/i2cvr_software_manager.cpp
+++ b/i2c-vr/i2cvr_software_manager.cpp
@@ -88,7 +88,8 @@
co_return false;
}
- software->setVersion(std::format("{:X}", sum));
+ software->setVersion(std::format("{:X}", sum),
+ SoftwareInf::SoftwareVersion::VersionPurpose::Other);
std::set<RequestedApplyTimes> allowedApplyTime = {
RequestedApplyTimes::Immediate, RequestedApplyTimes::OnReset};
diff --git a/test/common/exampledevice/example_device.cpp b/test/common/exampledevice/example_device.cpp
index da51131..86606fb 100644
--- a/test/common/exampledevice/example_device.cpp
+++ b/test/common/exampledevice/example_device.cpp
@@ -49,7 +49,8 @@
device->softwareCurrent = std::make_unique<Software>(ctx, *device);
- device->softwareCurrent->setVersion("v1.0");
+ device->softwareCurrent->setVersion("v1.0",
+ SoftwareVersion::VersionPurpose::Other);
device->softwareCurrent->setActivation(
SoftwareActivation::Activations::Active);