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 | |
| 9 | using PELEntryIface = sdbusplus::org::open_power::Logging::PEL::server::Entry; |
| 10 | using PropertiesVariant = PELEntryIface::PropertiesVariant; |
| 11 | |
| 12 | class PELEntry : public PELEntryIface |
| 13 | { |
| 14 | |
| 15 | public: |
| 16 | PELEntry() = delete; |
| 17 | PELEntry(const PELEntry&) = delete; |
| 18 | PELEntry& operator=(const PELEntry&) = delete; |
| 19 | PELEntry(PELEntry&&) = delete; |
| 20 | PELEntry& operator=(PELEntry&&) = delete; |
| 21 | virtual ~PELEntry() = default; |
| 22 | |
| 23 | /** @brief Constructor to put an object onto the bus at a dbus path. |
| 24 | * @param[in] bus - Bus to attach to. |
| 25 | * @param[in] path - Path to attach at. |
| 26 | * @param[in] prop - Default property values to be set when this interface |
| 27 | * is added to the bus. |
| 28 | * @param[in] id - obmc id for this instance. |
| 29 | * @param[in] repo - Repository pointer to lookup PEL to set appropriate |
| 30 | * attributes. |
| 31 | */ |
| 32 | |
Patrick Williams | 45e8352 | 2022-07-22 19:26:52 -0500 | [diff] [blame] | 33 | PELEntry(sdbusplus::bus_t& bus, const std::string& path, |
Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 34 | const std::map<std::string, PropertiesVariant>& prop, uint32_t id, |
| 35 | Repository* repo) : |
Matt Spinler | 734ed2b | 2022-01-21 09:31:46 -0600 | [diff] [blame] | 36 | PELEntryIface(bus, path.c_str(), prop, true), |
Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 37 | _obmcId(id), _repo(repo) |
| 38 | { |
| 39 | } |
| 40 | |
| 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 Spinler | 734ed2b | 2022-01-21 09:31:46 -0600 | [diff] [blame] | 68 | } // namespace openpower |