libpldmresponder: Add double property type for D-Bus backend
Add a handler with double property type in the get/setAttrValue methods.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I493678b57199e8f7c252da99292029f77eef482e
diff --git a/libpldmresponder/bios_integer_attribute.cpp b/libpldmresponder/bios_integer_attribute.cpp
index 23ffab3..d6d1214 100644
--- a/libpldmresponder/bios_integer_attribute.cpp
+++ b/libpldmresponder/bios_integer_attribute.cpp
@@ -87,6 +87,11 @@
return dbusHandler->setDbusProperty(*dBusMap,
static_cast<int64_t>(currentValue));
}
+ else if (dBusMap->propertyType == "double")
+ {
+ return dbusHandler->setDbusProperty(*dBusMap,
+ static_cast<double>(currentValue));
+ }
std::cerr << "Unsupported property type on dbus: " << dBusMap->propertyType
<< std::endl;
@@ -146,6 +151,10 @@
{
value = std::get<int64_t>(propertyValue);
}
+ else if (dBusMap->propertyType == "double")
+ {
+ value = std::get<double>(propertyValue);
+ }
return value;
}