blob: b05dc095f2ff1caa7a0698e9bba38c2938003859 [file] [log] [blame]
#include "occ_device.hpp"
#include "occ_status.hpp"
#include <iostream>
namespace open_power
{
namespace occ
{
fs::path Device::bindPath = fs::path(OCC_HWMON_PATH) / "bind";
fs::path Device::unBindPath = fs::path(OCC_HWMON_PATH) / "unbind";
bool Device::master() const
{
int master;
auto masterFile = fs::path(DEV_PATH) / config / "occ_master";
std::ifstream file(masterFile, std::ios::in);
if (!file)
{
return false;
}
file >> master;
file.close();
return (master != 0);
}
void Device::throttleProcTempCallback(bool error)
{
statusObject.throttleProcTemp(error);
}
void Device::throttleProcPowerCallback(bool error)
{
statusObject.throttleProcPower(error);
}
void Device::throttleMemTempCallback(bool error)
{
statusObject.throttleMemTemp(error);
}
} // namespace occ
} // namespace open_power