blob: 7a8fe1506a67338bd999de5c4bf5bece4fe2011f [file] [log] [blame]
Matt Spinler7f3c8a42022-01-21 09:26:06 -06001#pragma once
2
Matt Spinler8a09b982025-05-09 14:09:10 -05003#include <org/open_power/Logging/PEL/Entry/server.hpp>
4
Matt Spinler7f3c8a42022-01-21 09:26:06 -06005namespace openpower
6{
7namespace pels
8{
9
Willy Tu6ddbf692023-09-05 10:54:16 -070010using PELEntryIface = sdbusplus::server::org::open_power::logging::pel::Entry;
Matt Spinler7f3c8a42022-01-21 09:26:06 -060011using PropertiesVariant = PELEntryIface::PropertiesVariant;
12
Matt Spinler8a09b982025-05-09 14:09:10 -050013class Repository;
14
Matt Spinler7f3c8a42022-01-21 09:26:06 -060015class PELEntry : public PELEntryIface
16{
Matt Spinler7f3c8a42022-01-21 09:26:06 -060017 public:
18 PELEntry() = delete;
19 PELEntry(const PELEntry&) = delete;
20 PELEntry& operator=(const PELEntry&) = delete;
21 PELEntry(PELEntry&&) = delete;
22 PELEntry& operator=(PELEntry&&) = delete;
23 virtual ~PELEntry() = default;
24
25 /** @brief Constructor to put an object onto the bus at a dbus path.
26 * @param[in] bus - Bus to attach to.
27 * @param[in] path - Path to attach at.
28 * @param[in] prop - Default property values to be set when this interface
29 * is added to the bus.
30 * @param[in] id - obmc id for this instance.
31 * @param[in] repo - Repository pointer to lookup PEL to set appropriate
32 * attributes.
33 */
34
Patrick Williams45e83522022-07-22 19:26:52 -050035 PELEntry(sdbusplus::bus_t& bus, const std::string& path,
Matt Spinler7f3c8a42022-01-21 09:26:06 -060036 const std::map<std::string, PropertiesVariant>& prop, uint32_t id,
37 Repository* repo) :
Patrick Williams075c7922024-08-16 15:19:49 -040038 PELEntryIface(bus, path.c_str(), prop, true), _obmcId(id), _repo(repo)
Patrick Williams2544b412022-10-04 08:41:06 -050039 {}
Matt Spinler7f3c8a42022-01-21 09:26:06 -060040
41 /** @brief Update managementSystemAck flag.
42 * @param[in] value - A true value says HMC acknowledged the PEL.
43 * @returns New property value
44 */
45 bool managementSystemAck(bool value) override;
46
47 /**
48 * @brief Returns OpenBMC event log ID associated with this interface.
49 */
50 uint32_t getMyId(void) const
51 {
52 return _obmcId;
53 }
54
55 private:
56 /**
57 * @brief Corresponding OpenBMC event log id of this interface.
58 */
59 uint32_t _obmcId;
60
61 /**
62 * @brief Repository pointer to look for updating PEL fields.
63 */
64 Repository* _repo;
65};
66
67} // namespace pels
Matt Spinler734ed2b2022-01-21 09:31:46 -060068} // namespace openpower