blob: 35151283c9d50303484c1a6122b68d79ccbc14e6 [file] [log] [blame]
Matt Spinler7f3c8a42022-01-21 09:26:06 -06001#include "pel_entry.hpp"
2
Matt Spinler7f3c8a42022-01-21 09:26:06 -06003#include <xyz/openbmc_project/Common/error.hpp>
4
5namespace openpower
6{
7namespace pels
8{
9
10namespace common_error = sdbusplus::xyz::openbmc_project::Common::Error;
11
12bool 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