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