blob: 7fc9f72da34c0b2c534d7f1e5adfa1367d826c3a [file] [log] [blame]
#include "pel_entry.hpp"
#include <iostream>
#include <xyz/openbmc_project/Common/error.hpp>
namespace openpower
{
namespace pels
{
namespace common_error = sdbusplus::xyz::openbmc_project::Common::Error;
bool PELEntry::managementSystemAck(bool value)
{
auto current = sdbusplus::org::open_power::Logging::PEL::server::Entry::
managementSystemAck();
if (value != current)
{
current = sdbusplus::org::open_power::Logging::PEL::server::Entry::
managementSystemAck(value);
Repository::LogID id{Repository::LogID::Obmc(getMyId())};
if (auto logId = _repo->getLogID(id); logId.has_value())
{
// Update HMC acknowledge bit in PEL
_repo->setPELHMCTransState(
logId->pelID.id,
(value ? TransmissionState::acked : TransmissionState::newPEL));
}
else
{
throw common_error::InvalidArgument();
}
}
return current;
}
} // namespace pels
} // namespace openpower