xref: /openbmc/phosphor-pid-control/util.hpp (revision 1a153794)
1 #pragma once
2 
3 #include "pid/ec/pid.hpp"
4 
5 #include <phosphor-logging/log.hpp>
6 #include <sdbusplus/bus.hpp>
7 
8 #include <limits>
9 #include <string>
10 
11 namespace pid_control
12 {
13 
14 void tryRestartControlLoops(void);
15 
16 /*
17  * Given a configuration structure, fill out the information we use within the
18  * PID loop.
19  */
20 void initializePIDStruct(ec::pid_info_t* info, const ec::pidinfo& initial);
21 
22 void dumpPIDStruct(ec::pid_info_t* info);
23 
24 struct SensorThresholds
25 {
26     double lowerThreshold = std::numeric_limits<double>::quiet_NaN();
27     double upperThreshold = std::numeric_limits<double>::quiet_NaN();
28 };
29 
30 const std::string sensorintf = "xyz.openbmc_project.Sensor.Value";
31 const std::string criticalThreshInf =
32     "xyz.openbmc_project.Sensor.Threshold.Critical";
33 const std::string propertiesintf = "org.freedesktop.DBus.Properties";
34 
35 /*
36  * Given a path that optionally has a glob portion, fill it out.
37  */
38 std::string FixupPath(std::string original);
39 
40 } // namespace pid_control
41