sensorhandler: Add functionality to use m, b, b_exp from config.yaml
Change-Id: I1b5b8a5e0e5abd74eadde494728f363cf1ca4ec6
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/scripts/writesensor.mako.cpp b/scripts/writesensor.mako.cpp
index fbfe6a9..cb3be09 100644
--- a/scripts/writesensor.mako.cpp
+++ b/scripts/writesensor.mako.cpp
@@ -16,8 +16,12 @@
path = sensor["path"]
sensorType = sensor["sensorType"]
readingType = sensor["sensorReadingType"]
+ multiplier = sensor.get("multiplierM", 1)
+ offset = sensor.get("offsetB", 0)
+ exp = sensor.get("bExp", 0)
%>
- ${sensorType},"${path}",${readingType},{
+ ${sensorType},"${path}",${readingType},${multiplier},${offset},${exp},
+ ${offset * pow(10,exp)},{
% for interface,properties in interfaces.iteritems():
{"${interface}",{
% for dbus_property,property_value in properties.iteritems():