Sampa Misra | 46ece06 | 2020-03-18 07:17:44 -0500 | [diff] [blame] | 1 | #include "config.h" |
| 2 | |
John Wang | e2efdcc | 2020-02-12 17:02:06 +0800 | [diff] [blame] | 3 | #include "bios_attribute.hpp" |
| 4 | |
Sampa Misra | 46ece06 | 2020-03-18 07:17:44 -0500 | [diff] [blame] | 5 | #include "bios_config.hpp" |
John Wang | e2efdcc | 2020-02-12 17:02:06 +0800 | [diff] [blame] | 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 | |
Sampa Misra | 46ece06 | 2020-03-18 07:17:44 -0500 | [diff] [blame] | 34 | std::optional<DBusMapping> BIOSAttribute::getDBusMap() |
| 35 | { |
| 36 | return dBusMap; |
| 37 | } |
| 38 | |
John Wang | e2efdcc | 2020-02-12 17:02:06 +0800 | [diff] [blame] | 39 | } // namespace bios |
| 40 | } // namespace responder |
| 41 | } // namespace pldm |