blob: 036e0781bac1fdb7d8a16c64fe2fc996b190166f [file] [log] [blame]
Archana Kakani733b39d2024-06-05 21:05:20 -05001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include <sdbusplus/server.hpp>
5#include <sdbusplus/server/object.hpp>
6#include <xyz/openbmc_project/Inventory/Item/PCIeDevice/server.hpp>
7#include <xyz/openbmc_project/Inventory/Item/PCIeSlot/common.hpp>
8
9#include <string>
10
11namespace pldm
12{
13namespace dbus
14{
15using ItemDevice = sdbusplus::server::object_t<
16 sdbusplus::xyz::openbmc_project::Inventory::Item::server::PCIeDevice>;
17using Generations = sdbusplus::common::xyz::openbmc_project::inventory::item::
18 PCIeSlot::Generations;
19
20/**
21 * @class PCIeDevice
22 * @brief PCIeDevice DBUS support, also includes the device properties
23 */
24
25class PCIeDevice : public ItemDevice
26{
27 public:
28 PCIeDevice() = delete;
29 ~PCIeDevice() = default;
30 PCIeDevice(const PCIeDevice&) = delete;
31 PCIeDevice& operator=(const PCIeDevice&) = delete;
32
33 PCIeDevice(sdbusplus::bus_t& bus, const std::string& objPath) :
34 ItemDevice(bus, objPath.c_str())
35 {}
36
37 /** Get lanes in use */
38 size_t lanesInUse() const override;
39
40 /** Set lanes in use */
41 size_t lanesInUse(size_t value) override;
42
43 /** Get Generation in use */
44 Generations generationInUse() const override;
45
46 /** Set Generation in use */
47 Generations generationInUse(Generations value) override;
48};
49
50} // namespace dbus
51} // namespace pldm