diff options
author | Emily Shaffer <emilyshaffer@google.com> | 2017-06-14 13:06:26 -0700 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-12-10 05:49:24 +0000 |
commit | 6223561894d2ab60cf4af2c5b5cc930c0a26d8c2 (patch) | |
tree | ddd825a857344df4ac21f50925b913e6556d1ad1 /types.hpp | |
parent | dd9943119afe553f930694214d7fa40771f7f89b (diff) | |
download | phosphor-host-ipmid-6223561894d2ab60cf4af2c5b5cc930c0a26d8c2.tar.gz phosphor-host-ipmid-6223561894d2ab60cf4af2c5b5cc930c0a26d8c2.zip |
sensorhandler: allow preconfigured unit and scale
Allow specifying the scale and unit for a sensor in the
YAML configuration. This can save clock time by no longer
requiring the daemon to reach out to the sensor owner for
the information.
Change-Id: I5f63286fc32fb9d64ebab7d86d1dbb7ff40591f4
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'types.hpp')
-rw-r--r-- | types.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -113,6 +113,8 @@ using Multiplier = uint16_t; using OffsetB = uint16_t; using Exponent = uint8_t; using ScaledOffset = int64_t; +using Scale = int16_t; +using Unit = std::string; enum class Mutability { @@ -142,6 +144,9 @@ struct Info OffsetB coefficientB; Exponent exponentB; ScaledOffset scaledOffset; + bool hasScale; + Scale scale; + Unit unit; std::function<uint8_t(SetSensorReadingReq&, const Info&)> updateFunc; std::function<GetSensorResponse(const Info&)> getFunc; Mutability mutability; |