1 #include <iostream>
2 #include "occ_device.hpp"
3 #include "occ_status.hpp"
4 
5 namespace open_power
6 {
7 namespace occ
8 {
9 
10 fs::path Device::bindPath = fs::path(OCC_HWMON_PATH) / "bind";
11 fs::path Device::unBindPath = fs::path(OCC_HWMON_PATH) / "unbind";
12 
13 bool Device::master() const
14 {
15     int master;
16     auto masterFile = fs::path(DEV_PATH) / config / "occ_master";
17     std::ifstream file(masterFile, std::ios::in);
18 
19     if (!file)
20     {
21         return false;
22     }
23 
24     file >> master;
25     file.close();
26     return (master != 0);
27 }
28 
29 void Device::throttleProcTempCallback(bool error)
30 {
31         statusObject.throttleProcTemp(error);
32 }
33 
34 void Device::throttleProcPowerCallback(bool error)
35 {
36         statusObject.throttleProcPower(error);
37 }
38 
39 void Device::throttleMemTempCallback(bool error)
40 {
41         statusObject.throttleMemTemp(error);
42 }
43 
44 } // namespace occ
45 } // namespace open_power
46