blob: dc0a49aec10c7dcb5e6069a73548bbd62892a54e [file] [log] [blame]
Josh Lehan2a40e932020-09-02 11:48:14 -07001#pragma once
2
Josh Lehan2a40e932020-09-02 11:48:14 -07003#include <string>
4
Ed Tanous6cb732a2021-02-18 15:33:51 -08005namespace sensor_paths
Josh Lehan2a40e932020-09-02 11:48:14 -07006{
7
Josh Lehan2a40e932020-09-02 11:48:14 -07008// This is an allowlist of the units a sensor can measure. Should be in sync
9// with
Konstantin Aladyshevce6bcdf2022-06-09 20:03:46 +030010// phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Sensor/Value.interface.yaml#L38
Josh Lehan2a40e932020-09-02 11:48:14 -070011
Zev Weiss6b6891c2021-04-22 02:46:21 -050012constexpr const char* unitDegreesC =
13 "xyz.openbmc_project.Sensor.Value.Unit.DegreesC";
14constexpr const char* unitRPMs = "xyz.openbmc_project.Sensor.Value.Unit.RPMS";
15constexpr const char* unitVolts = "xyz.openbmc_project.Sensor.Value.Unit.Volts";
16constexpr const char* unitMeters =
17 "xyz.openbmc_project.Sensor.Value.Unit.Meters";
18constexpr const char* unitAmperes =
19 "xyz.openbmc_project.Sensor.Value.Unit.Amperes";
20constexpr const char* unitWatts = "xyz.openbmc_project.Sensor.Value.Unit.Watts";
21constexpr const char* unitJoules =
22 "xyz.openbmc_project.Sensor.Value.Unit.Joules";
23constexpr const char* unitPercent =
24 "xyz.openbmc_project.Sensor.Value.Unit.Percent";
25constexpr const char* unitCFM = "xyz.openbmc_project.Sensor.Value.Unit.CFM";
Bruce Mitchell323969b2021-07-15 16:23:00 -050026constexpr const char* unitPascals =
27 "xyz.openbmc_project.Sensor.Value.Unit.Pascals";
Potin Laia9c1bec2024-04-19 08:35:56 +080028constexpr const char* unitPercentRH =
29 "xyz.openbmc_project.Sensor.Value.Unit.PercentRH";
Zev Weiss6b6891c2021-04-22 02:46:21 -050030
Ed Tanous6cb732a2021-02-18 15:33:51 -080031std::string getPathForUnits(const std::string& units);
Josh Lehan2a40e932020-09-02 11:48:14 -070032
Ed Tanous6cb732a2021-02-18 15:33:51 -080033std::string escapePathForDbus(const std::string& name);
34
35} // namespace sensor_paths