1 #include "pel_entry.hpp"
2 
3 #include <xyz/openbmc_project/Common/error.hpp>
4 
5 namespace openpower
6 {
7 namespace pels
8 {
9 
10 namespace common_error = sdbusplus::xyz::openbmc_project::Common::Error;
11 
12 bool PELEntry::managementSystemAck(bool value)
13 {
14     auto current = sdbusplus::org::open_power::Logging::PEL::server::Entry::
15         managementSystemAck();
16     if (value != current)
17     {
18         current = sdbusplus::org::open_power::Logging::PEL::server::Entry::
19             managementSystemAck(value);
20 
21         Repository::LogID id{Repository::LogID::Obmc(getMyId())};
22         if (auto logId = _repo->getLogID(id); logId.has_value())
23         {
24             // Update HMC acknowledge bit in PEL
25             _repo->setPELHMCTransState(
26                 logId->pelID.id,
27                 (value ? TransmissionState::acked : TransmissionState::newPEL));
28         }
29         else
30         {
31             throw common_error::InvalidArgument();
32         }
33     }
34     return current;
35 }
36 
37 } // namespace pels
38 } // namespace openpower
39