blob: a998b53939c9d38c48829b8ae569ccd144dd5060 [file] [log] [blame]
John Wange2efdcc2020-02-12 17:02:06 +08001#include "bios_attribute.hpp"
2
3#include "utils.hpp"
4
5#include <iostream>
6#include <variant>
7
8namespace pldm
9{
10namespace responder
11{
12namespace bios
13{
14
15BIOSAttribute::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