Change primary postcode interface to byte array
Change primary code to std::vector<uint8_t> to meet the changes in
phosphor-dbus-interface.
[1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/74633
Change-Id: Ie1207d703f8bc1ad42fedc5bcbcbd0e4c23dacde
Signed-off-by: Cosmo Chou <cosmo.chou@quantatw.com>
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
diff --git a/src/groupextcommands.cpp b/src/groupextcommands.cpp
index 8fa9f08..eb6b48e 100644
--- a/src/groupextcommands.cpp
+++ b/src/groupextcommands.cpp
@@ -24,7 +24,7 @@
ipmi::RspType<> ipmiSBMRSendBootProgress(ipmi::Context::ptr ctx,
std::vector<uint8_t> data)
{
- using postcode_t = std::tuple<uint64_t, std::vector<uint8_t>>;
+ using postcode_t = std::tuple<std::vector<uint8_t>, std::vector<uint8_t>>;
std::optional<size_t> hostId = findHost(ctx->hostIdx);
@@ -43,11 +43,7 @@
try
{
- auto primaryPostCode = reinterpret_cast<const uint64_t*>(data.data());
- auto secondaryPostCode =
- std::vector<uint8_t>(data.begin() + 8, data.end());
- auto postCode =
- postcode_t(bigEndianToHost(*primaryPostCode), secondaryPostCode);
+ postcode_t postCode(std::move(data), {});
auto conn = getSdBus();
auto hostbootRawObj =
std::string(bootRawObjPrefix) + std::to_string(*hostId);
@@ -55,7 +51,8 @@
conn->new_method_call(bootRawBusName, hostbootRawObj.data(),
"org.freedesktop.DBus.Properties", "Set");
- method.append(bootRawIntf, "Value", std::variant<postcode_t>(postCode));
+ method.append(bootRawIntf, "Value",
+ std::variant<postcode_t>(std::move(postCode)));
conn->call_noreply(method);
}