blob: b0b834e2fb4027ad0f058523950f949347ea449c [file] [log] [blame]
Sampa Misra46ece062020-03-18 07:17:44 -05001#include "config.h"
2
John Wange2efdcc2020-02-12 17:02:06 +08003#include "bios_attribute.hpp"
4
Sampa Misra46ece062020-03-18 07:17:44 -05005#include "bios_config.hpp"
Deepak Kodihallid130e1a2020-06-17 05:55:32 -05006#include "common/utils.hpp"
John Wange2efdcc2020-02-12 17:02:06 +08007
8#include <iostream>
9#include <variant>
10
11namespace pldm
12{
13namespace responder
14{
15namespace bios
16{
17
18BIOSAttribute::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 Misra46ece062020-03-18 07:17:44 -050034std::optional<DBusMapping> BIOSAttribute::getDBusMap()
35{
36 return dBusMap;
37}
38
John Wange2efdcc2020-02-12 17:02:06 +080039} // namespace bios
40} // namespace responder
41} // namespace pldm