blob: 9da0e6043f0ac703e3a60227e88ddf244db8cc82 [file] [log] [blame]
Dung Caob6d39432024-06-05 03:46:47 +00001#pragma once
2
3#include "xyz/openbmc_project/Inventory/Decorator/Asset/server.hpp"
4#include "xyz/openbmc_project/Inventory/Decorator/AssetTag/server.hpp"
5#include "xyz/openbmc_project/Inventory/Decorator/Compatible/server.hpp"
6#include "xyz/openbmc_project/Inventory/Decorator/Revision/server.hpp"
7#include "xyz/openbmc_project/Inventory/Item/Board/server.hpp"
8
9#include <sdbusplus/bus.hpp>
10#include <sdbusplus/server/object.hpp>
11
12#include <map>
13
14namespace pldm
15{
16namespace dbus_api
17{
18
19using assetserver =
20 sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Asset;
21using assettagserver =
22 sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::AssetTag;
23using revisionserver =
24 sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Revision;
25using compatibleserver =
26 sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Compatible;
27using boardserver =
28 sdbusplus::xyz::openbmc_project::Inventory::Item::server::Board;
29
Patrick Williamsefa00322025-01-18 02:36:22 -050030using AssetIntf = sdbusplus::server::object_t<assetserver>;
31using AssetTagIntf = sdbusplus::server::object_t<assettagserver>;
32using RevisionIntf = sdbusplus::server::object_t<revisionserver>;
33using CompatibleIntf = sdbusplus::server::object_t<compatibleserver>;
34using BoardIntf = sdbusplus::server::object_t<boardserver>;
Dung Caob6d39432024-06-05 03:46:47 +000035
36/** @class PldmEntityRequester
37 * @brief OpenBMC PLDM Inventory entity implementation.
38 * @details A concrete implementation for the PLDM Inventory entity DBus APIs.
39 */
40class PldmEntityReq :
41 public AssetIntf,
42 public AssetTagIntf,
43 public RevisionIntf,
44 public CompatibleIntf,
45 public BoardIntf
46{
47 public:
48 PldmEntityReq() = delete;
49 PldmEntityReq(const PldmEntityReq&) = delete;
50 PldmEntityReq& operator=(const PldmEntityReq&) = delete;
51 PldmEntityReq(PldmEntityReq&&) = delete;
52 PldmEntityReq& operator=(PldmEntityReq&&) = delete;
53 virtual ~PldmEntityReq() = default;
54
55 /** @brief Constructor to put object onto bus at a dbus path.
56 * @param[in] bus - Bus to attach to.
57 * @param[in] path - Path to attach at.
58 */
59 PldmEntityReq(sdbusplus::bus_t& bus, const std::string& path) :
60 AssetIntf(bus, path.c_str()), AssetTagIntf(bus, path.c_str()),
61 RevisionIntf(bus, path.c_str()), CompatibleIntf(bus, path.c_str()),
62 BoardIntf(bus, path.c_str()) {};
63
64 /** @brief Set value of partNumber in Decorator.Asset */
65 std::string partNumber(std::string value);
66
67 /** @brief Set value of serialNumber in Decorator.Asset */
68 std::string serialNumber(std::string value);
69
70 /** @brief Set value of manufacturer in Decorator.Asset */
71 std::string manufacturer(std::string value);
72
73 /** @brief Set value of buildDate in Decorator.Asset */
74 std::string buildDate(std::string value);
75
76 /** @brief Set value of model in Decorator.Asset */
77 std::string model(std::string value);
78
79 /** @brief Set value of subModel in Decorator.Asset */
80 std::string subModel(std::string value);
81
82 /** @brief Set value of sparePartNumber in Decorator.Asset */
83 std::string sparePartNumber(std::string value);
84
85 /** @brief Set value of assetTag in Decorator.AssetTag */
86 std::string assetTag(std::string value);
87
88 /** @brief Set value of version in Decorator.Revision */
89 std::string version(std::string value);
90
91 /** @brief Set value of names in in Decorator.Compatible */
92 std::vector<std::string> names(std::vector<std::string> values);
93};
94
95} // namespace dbus_api
96} // namespace pldm