summaryrefslogtreecommitdiffstats
path: root/types.hpp
diff options
context:
space:
mode:
authorEmily Shaffer <emilyshaffer@google.com>2017-06-14 13:06:26 -0700
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-12-10 05:49:24 +0000
commit6223561894d2ab60cf4af2c5b5cc930c0a26d8c2 (patch)
treeddd825a857344df4ac21f50925b913e6556d1ad1 /types.hpp
parentdd9943119afe553f930694214d7fa40771f7f89b (diff)
downloadphosphor-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.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/types.hpp b/types.hpp
index 0177c8f..a43c8c0 100644
--- a/types.hpp
+++ b/types.hpp
@@ -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;
OpenPOWER on IntegriCloud