sensor: Add function to map dbus info to reading field

For sensor's with reading type eventData2, the eventdata2 field is
mapped to the reading field in the get sensor reading command
response.

Change-Id: I9ad85ddb48d6c273a22e476e29ea9bbb34c13e24
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/sensorhandler.h b/sensorhandler.h
index 576c803..a078693 100644
--- a/sensorhandler.h
+++ b/sensorhandler.h
@@ -499,6 +499,17 @@
     }
 }
 
+/**
+ * @brief Set the reading field in the response.
+ *
+ * @param[in] offset - offset number.
+ * @param[in/out] resp - get sensor reading response.
+ */
+inline void setReading(uint8_t value, ipmi::sensor::GetReadingResponse* resp)
+{
+    resp->reading = value;
+}
+
 } // namespace sensor
 
 } // namespace ipmi