xref: /openbmc/phosphor-pid-control/util.hpp (revision 5f59c0fd)
1 #pragma once
2 
3 #include <string>
4 
5 /* This program assumes sensors use the Sensor.Value interface
6  * and for sensor->write() I only implemented sysfs as a type,
7  * but -- how would it know whether to use Control.FanSpeed or Control.FanPwm?
8  *
9  * One could get the interface list for the object and search for Control.*
10  * but, it needs to know the maximum, minimum.  The only sensors it wants to
11  * write in this code base are Fans...
12  */
13 enum class IOInterfaceType
14 {
15     NONE, // There is no interface.
16     EXTERNAL,
17     DBUSPASSIVE,
18     DBUSACTIVE, // This means for write that it needs to look up the interface.
19     SYSFS,
20     UNKNOWN
21 };
22 
23 /* WriteInterfaceType is different because Dbusactive/passive. how to know... */
24 IOInterfaceType getWriteInterfaceType(const std::string& path);
25 
26 IOInterfaceType getReadInterfaceType(const std::string& path);
27