#include "fan_pwm.hpp" #include "env.hpp" #include "hwmon.hpp" #include "hwmonio.hpp" #include "sensorset.hpp" #include "sysfs.hpp" #include #include #include #include using namespace phosphor::logging; namespace hwmon { uint64_t FanPwm::target(uint64_t value) { using namespace std::literals; std::string empty; // Write target out to sysfs try { ioAccess->write(value, type, id, empty, hwmonio::retries, hwmonio::delay); } catch (const std::system_error& e) { using namespace sdbusplus::xyz::openbmc_project::Control::Device::Error; report( xyz::openbmc_project::Control::Device::WriteFailure::CALLOUT_ERRNO( e.code().value()), xyz::openbmc_project::Control::Device::WriteFailure:: CALLOUT_DEVICE_PATH(devPath.c_str())); auto file = sysfs::make_sysfs_path(ioAccess->path(), type, id, empty); log("Logging failing sysfs file", phosphor::logging::entry("FILE=%s", file.c_str())); exit(EXIT_FAILURE); } return FanPwmObject::target(value); } } // namespace hwmon