blob: 3fecffda798e8ad1d0ce9257fe6fe046279c4592 [file] [log] [blame]
/*
// Copyright (c) 2021 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
*/
#pragma once
#include <error_monitors/base_gpio_monitor.hpp>
#include <host_error_monitor.hpp>
#include <sdbusplus/asio/object_server.hpp>
namespace host_error_monitor::vr_hot_monitor
{
class VRHotMonitor :
public host_error_monitor::base_gpio_monitor::BaseGPIOMonitor
{
const static host_error_monitor::base_gpio_monitor::AssertValue
assertValue =
host_error_monitor::base_gpio_monitor::AssertValue::lowAssert;
std::string vrName;
void logEvent() override
{
std::string msg = vrName + " Voltage Regulator Overheated.";
log_message(LOG_INFO, msg, "OpenBMC.0.1.VoltageRegulatorOverheated",
vrName);
}
public:
VRHotMonitor(boost::asio::io_context& io,
std::shared_ptr<sdbusplus::asio::connection> conn,
const std::string& signalName, const std::string& vrName) :
BaseGPIOMonitor(io, conn, signalName, assertValue),
vrName(vrName)
{
if (valid)
{
startMonitoring();
}
}
};
} // namespace host_error_monitor::vr_hot_monitor