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 std::string getSensorPath(const std::string& type, const std::string& id); 36 std::string getMatch(const std::string& type, const std::string& id); 37 void scaleSensorReading(const double min, const double max, double& value); 38 bool validType(const std::string& type); 39 40 /* 41 * Given a path that optionally has a glob portion, fill it out. 42 */ 43 std::string FixupPath(std::string original); 44 45 } // namespace pid_control 46