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