[cleanup] sensor: Fix function declaration constness
Add const qualifier to a couple of getter methods such that they can be
used with a const reference object. Also, const bool doesn't make sense.
Change-Id: Ib3127aba83c2f9c2479ada7078147358103188ff
Signed-off-by: Kun Yi <kunyi731@gmail.com>
diff --git a/sensor.hpp b/sensor.hpp
index ac818d0..3ec3dda 100644
--- a/sensor.hpp
+++ b/sensor.hpp
@@ -60,7 +60,7 @@
*
* @return - Sensor adjustment struct
*/
- inline const valueAdjust& getAdjusts()
+ inline const valueAdjust& getAdjusts() const
{
return _sensorAdjusts;
}
@@ -109,7 +109,7 @@
*
* @return - Scale value
*/
- inline int64_t getScale(void)
+ inline int64_t getScale(void) const
{
return _scale;
}
@@ -119,7 +119,7 @@
*
* @return - Pointer to the GPIO handle interface, can be nullptr.
*/
- inline const gpioplus::HandleInterface* getGpio(void)
+ inline const gpioplus::HandleInterface* getGpio(void) const
{
return _handle.get();
}
@@ -129,7 +129,7 @@
*
* @return - Boolean on whether the sensor has a fault file
*/
- inline const bool hasFaultFile(void)
+ inline bool hasFaultFile(void) const
{
return _hasFaultFile;
}