Edward A. James | 636577f | 2017-10-06 10:53:55 -0500 | [diff] [blame^] | 1 | #include <iostream> |
Vishwanatha Subbanna | 32e84e9 | 2017-06-28 19:17:28 +0530 | [diff] [blame] | 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 | |
Edward A. James | 636577f | 2017-10-06 10:53:55 -0500 | [diff] [blame^] | 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 | |
Vishwanatha Subbanna | 32e84e9 | 2017-06-28 19:17:28 +0530 | [diff] [blame] | 28 | } // namespace occ |
| 29 | } // namespace open_power |