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