forked from openbmc/pldm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdbus_impl_pdr.hpp
70 lines (58 loc) · 2.05 KB
/
dbus_impl_pdr.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#include "libpldm/pdr.h"
#include "libpldm/platform.h"
#include "xyz/openbmc_project/PLDM/PDR/server.hpp"
#include <sdbusplus/bus.hpp>
#include <sdbusplus/server/object.hpp>
#include <vector>
namespace pldm
{
namespace dbus_api
{
using PdrIntf = sdbusplus::server::object::object<
sdbusplus::xyz::openbmc_project::PLDM::server::PDR>;
/** @class Pdr
* @brief OpenBMC PLDM.PDR Implementation
* @details A concrete implementation for the
* xyz.openbmc_project.PLDM.PDR DBus APIs.
*/
class Pdr : public PdrIntf
{
public:
Pdr() = delete;
Pdr(const Pdr&) = delete;
Pdr& operator=(const Pdr&) = delete;
Pdr(Pdr&&) = delete;
Pdr& operator=(Pdr&&) = delete;
virtual ~Pdr() = default;
/** @brief Constructor to put object onto bus at a dbus path.
* @param[in] bus - Bus to attach to.
* @param[in] path - Path to attach at.
* @param[in] repo - pointer to BMC's primary PDR repo
*/
Pdr(sdbusplus::bus::bus& bus, const std::string& path,
const pldm_pdr* repo) :
PdrIntf(bus, path.c_str(), repo),
pdrRepo(repo){};
/** @brief Implementation for PdrIntf.FindStateEffecterPDR
* @param[in] tid - PLDM terminus ID.
* @param[in] entityID - entity that can be associated with PLDM State set.
* @param[in] stateSetId - value that identifies PLDM State set.
*/
std::vector<std::vector<uint8_t>>
findStateEffecterPDR(uint8_t tid, uint16_t entityID,
uint16_t stateSetId) override;
/** @brief Implementation for PdrIntf.FindStateSensorPDR
* @param[in] tid - PLDM terminus ID.
* @param[in] entityID - entity that can be associated with PLDM State set.
* @param[in] stateSetId - value that identifies PLDM State set.
*/
std::vector<std::vector<uint8_t>>
findStateSensorPDR(uint8_t tid, uint16_t entityID,
uint16_t stateSetId) override;
private:
/** @brief pointer to BMC's primary PDR repo */
const pldm_pdr* pdrRepo;
};
} // namespace dbus_api
} // namespace pldm