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