blob: 89e9dd08cc0ad8dc39cc7eaba4cb7bd4f9aaa81f [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{
Willy Tu6ddbf692023-09-05 10:54:16 -070014 auto current = sdbusplus::server::org::open_power::logging::pel::Entry::
Matt Spinler7f3c8a42022-01-21 09:26:06 -060015 managementSystemAck();
16 if (value != current)
17 {
Willy Tu6ddbf692023-09-05 10:54:16 -070018 current = sdbusplus::server::org::open_power::logging::pel::Entry::
Matt Spinler7f3c8a42022-01-21 09:26:06 -060019 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