blob: b776b50f7ebd804467f5a874506a511de25dd5c9 [file] [log] [blame]
Josh Lehan2a40e932020-09-02 11:48:14 -07001#pragma once
2
3#include <cstring>
4#include <string>
5
Ed Tanous6cb732a2021-02-18 15:33:51 -08006namespace sensor_paths
Josh Lehan2a40e932020-09-02 11:48:14 -07007{
8
Josh Lehan2a40e932020-09-02 11:48:14 -07009// This is an allowlist of the units a sensor can measure. Should be in sync
10// with
Konstantin Aladyshevce6bcdf2022-06-09 20:03:46 +030011// phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Sensor/Value.interface.yaml#L38
Josh Lehan2a40e932020-09-02 11:48:14 -070012
Zev Weiss6b6891c2021-04-22 02:46:21 -050013constexpr const char* unitDegreesC =
14 "xyz.openbmc_project.Sensor.Value.Unit.DegreesC";
15constexpr const char* unitRPMs = "xyz.openbmc_project.Sensor.Value.Unit.RPMS";
16constexpr const char* unitVolts = "xyz.openbmc_project.Sensor.Value.Unit.Volts";
17constexpr const char* unitMeters =
18 "xyz.openbmc_project.Sensor.Value.Unit.Meters";
19constexpr const char* unitAmperes =
20 "xyz.openbmc_project.Sensor.Value.Unit.Amperes";
21constexpr const char* unitWatts = "xyz.openbmc_project.Sensor.Value.Unit.Watts";
22constexpr const char* unitJoules =
23 "xyz.openbmc_project.Sensor.Value.Unit.Joules";
24constexpr const char* unitPercent =
25 "xyz.openbmc_project.Sensor.Value.Unit.Percent";
26constexpr const char* unitCFM = "xyz.openbmc_project.Sensor.Value.Unit.CFM";
Bruce Mitchell323969b2021-07-15 16:23:00 -050027constexpr const char* unitPascals =
28 "xyz.openbmc_project.Sensor.Value.Unit.Pascals";
Potin Laia9c1bec2024-04-19 08:35:56 +080029constexpr const char* unitPercentRH =
30 "xyz.openbmc_project.Sensor.Value.Unit.PercentRH";
Zev Weiss6b6891c2021-04-22 02:46:21 -050031
Ed Tanous6cb732a2021-02-18 15:33:51 -080032std::string getPathForUnits(const std::string& units);
Josh Lehan2a40e932020-09-02 11:48:14 -070033
Ed Tanous6cb732a2021-02-18 15:33:51 -080034std::string escapePathForDbus(const std::string& name);
35
36} // namespace sensor_paths