Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "manager.hpp" |
| 4 | namespace openpower |
| 5 | { |
| 6 | namespace pels |
| 7 | { |
| 8 | |
Willy Tu | 6ddbf69 | 2023-09-05 10:54:16 -0700 | [diff] [blame] | 9 | using PELEntryIface = sdbusplus::server::org::open_power::logging::pel::Entry; |
Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 10 | using PropertiesVariant = PELEntryIface::PropertiesVariant; |
| 11 | |
| 12 | class PELEntry : public PELEntryIface |
| 13 | { |
Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 14 | 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 Williams | 45e8352 | 2022-07-22 19:26:52 -0500 | [diff] [blame] | 32 | PELEntry(sdbusplus::bus_t& bus, const std::string& path, |
Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 33 | const std::map<std::string, PropertiesVariant>& prop, uint32_t id, |
| 34 | Repository* repo) : |
Matt Spinler | 734ed2b | 2022-01-21 09:31:46 -0600 | [diff] [blame] | 35 | PELEntryIface(bus, path.c_str(), prop, true), |
Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 36 | _obmcId(id), _repo(repo) |
Patrick Williams | 2544b41 | 2022-10-04 08:41:06 -0500 | [diff] [blame] | 37 | {} |
Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 38 | |
| 39 | /** @brief Update managementSystemAck flag. |
| 40 | * @param[in] value - A true value says HMC acknowledged the PEL. |
| 41 | * @returns New property value |
| 42 | */ |
| 43 | bool managementSystemAck(bool value) override; |
| 44 | |
| 45 | /** |
| 46 | * @brief Returns OpenBMC event log ID associated with this interface. |
| 47 | */ |
| 48 | uint32_t getMyId(void) const |
| 49 | { |
| 50 | return _obmcId; |
| 51 | } |
| 52 | |
| 53 | private: |
| 54 | /** |
| 55 | * @brief Corresponding OpenBMC event log id of this interface. |
| 56 | */ |
| 57 | uint32_t _obmcId; |
| 58 | |
| 59 | /** |
| 60 | * @brief Repository pointer to look for updating PEL fields. |
| 61 | */ |
| 62 | Repository* _repo; |
| 63 | }; |
| 64 | |
| 65 | } // namespace pels |
Matt Spinler | 734ed2b | 2022-01-21 09:31:46 -0600 | [diff] [blame] | 66 | } // namespace openpower |