Extend the list of supported dbus property types
The Value type represents all types that are possible for a FRU info.
Most fields in a FRU info are boolean or string. There is also a
3-byte timestamp that, being converted to unix time, fits well into
uint64_t.
However for multirecord area records, there may be other data types,
not all of which are directly listed in IPMI FRU specification.
Hence, this Value type will now list all types possible for dbus nodes
with sdbusplus except for unixfd, object_path, and signature.
The class of Value will also be changed to std::variant per
request of Vernon Mauery, as part of effort to free the sdbusplus
library of extraneous features.
Part of:
https://gerrit.openbmc-project.xyz/q/topic:FRU-MultiRecord
Change-Id: I5d688ba9c14fa77cbe5171bd2ac7610e89c08220
Signed-off-by: Alexander Amelkin <a.amelkin@yadro.com>
diff --git a/types.hpp b/types.hpp
index d4f656c..46abfe0 100644
--- a/types.hpp
+++ b/types.hpp
@@ -3,6 +3,7 @@
#include <map>
#include <sdbusplus/message.hpp>
#include <string>
+#include <variant>
namespace ipmi
{
@@ -12,7 +13,18 @@
using Path = std::string;
using Property = std::string;
-using Value = sdbusplus::message::variant<bool, int64_t, std::string>;
+/// The Value type represents all types that are possible for a FRU info.
+/// Most fields in a FRU info are boolean or string. There is also a
+/// 3-byte timestamp that, being converted to unix time, fits well into
+/// uint64_t.
+///
+/// However for multirecord area records, there may be other data types,
+/// not all of which are directly listed in IPMI FRU specification.
+///
+/// Hence, this type lists all types possible for sbdusplus except for
+/// unixfd, object_path, and signature.
+using Value = std::variant<bool, uint8_t, uint16_t, int16_t, uint32_t, int32_t,
+ uint64_t, int64_t, double, std::string>;
using PropertyMap = std::map<Property, Value>;
using Interface = std::string;