1 #include <iostream> 2 #include "occ_device.hpp" 3 4 namespace open_power 5 { 6 namespace occ 7 { 8 9 fs::path Device::bindPath = fs::path(OCC_HWMON_PATH) / "bind"; 10 fs::path Device::unBindPath = fs::path(OCC_HWMON_PATH) / "unbind"; 11 12 bool Device::master() const 13 { 14 int master; 15 auto masterFile = fs::path(DEV_PATH) / config / "occ_master"; 16 std::ifstream file(masterFile, std::ios::in); 17 18 if (!file) 19 { 20 return false; 21 } 22 23 file >> master; 24 file.close(); 25 return (master != 0); 26 } 27 28 } // namespace occ 29 } // namespace open_power 30