blob: 812950202024e1d7fc2606b6cce9534c6893b5bd [file] [log] [blame]
Edward A. James636577f2017-10-06 10:53:55 -05001#include <iostream>
Vishwanatha Subbanna32e84e92017-06-28 19:17:28 +05302#include "occ_device.hpp"
3
4namespace open_power
5{
6namespace occ
7{
8
9fs::path Device::bindPath = fs::path(OCC_HWMON_PATH) / "bind";
10fs::path Device::unBindPath = fs::path(OCC_HWMON_PATH) / "unbind";
11
Edward A. James636577f2017-10-06 10:53:55 -050012bool 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 Subbanna32e84e92017-06-28 19:17:28 +053028} // namespace occ
29} // namespace open_power