Fix read std::vector message issue.
Using sdbusplus::message::variant<std::vector<>> to read
vector property message through dbus, and using
sdbusplus::message::variant_ns::get<std::vector<>> to
get vector property.
TestBy: ipmitool raw 0x30 0x9a
Change-Id: Ide0efdd76c5280c4cfbf942c28b2c87219ba7155
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
diff --git a/src/oemcommands.cpp b/src/oemcommands.cpp
index c807255..3435a1b 100644
--- a/src/oemcommands.cpp
+++ b/src/oemcommands.cpp
@@ -349,21 +349,24 @@
resp->resetCfg = sdbusplus::message::variant_ns::get<uint8_t>(variant);
std::vector<uint8_t> caterrStatus;
+ sdbusplus::message::variant<std::vector<uint8_t>> message;
auto method =
dbus.new_method_call(service.c_str(), processorErrConfigObjPath,
"org.freedesktop.DBus.Properties", "Get");
method.append(processorErrConfigIntf, "CATERRStatus");
+ auto reply = dbus.call(method);
try
{
- auto reply = dbus.call(method);
- reply.read(caterrStatus);
+ reply.read(message);
+ caterrStatus =
+ sdbusplus::message::variant_ns::get<std::vector<uint8_t>>(message);
}
catch (sdbusplus::exception_t&)
{
- phosphor::logging::log<phosphor::logging::level::DEBUG>(
+ phosphor::logging::log<phosphor::logging::level::ERR>(
"ipmiOEMGetProcessorErrConfig: error on dbus",
phosphor::logging::entry("PRORPERTY=CATERRStatus"),
phosphor::logging::entry("PATH=%s", processorErrConfigObjPath),