1 #include "bios_attribute.hpp"
2 
3 #include "utils.hpp"
4 
5 #include <iostream>
6 #include <variant>
7 
8 namespace pldm
9 {
10 namespace responder
11 {
12 namespace bios
13 {
14 
15 BIOSAttribute::BIOSAttribute(const Json& entry,
16                              DBusHandler* const dbusHandler) :
17     name(entry.at("attribute_name")),
18     readOnly(!entry.contains("dbus")), dbusHandler(dbusHandler)
19 {
20     if (!readOnly)
21     {
22         std::string objectPath = entry.at("dbus").at("object_path");
23         std::string interface = entry.at("dbus").at("interface");
24         std::string propertyName = entry.at("dbus").at("property_name");
25         std::string propertyType = entry.at("dbus").at("property_type");
26 
27         dBusMap = {objectPath, interface, propertyName, propertyType};
28     }
29 }
30 
31 } // namespace bios
32 } // namespace responder
33 } // namespace pldm
34