monitor: Subscribe to tach target and feedback services

Subscribes to nameOwnerChanged signals for the services of the sensor
and target interfaces for each configured fan. If those services go
offline, the fan tach sensors should get marked nonfunctional due to no
longer receiving updated target or feedback values. In this design, we
use the existing method of determining when a fan tach sensor should be
marked nonfunctional to allow a recovery window, wherein a brief
offline/online transition (such as during a restart) will not trigger a
nonfunctional state change.

Change-Id: I0a935ccad5a864dc952d023185356a1ef1226830
Signed-off-by: Mike Capps <mikepcapps@gmail.com>
diff --git a/monitor/tach_sensor.hpp b/monitor/tach_sensor.hpp
index ece1d85..27174f5 100644
--- a/monitor/tach_sensor.hpp
+++ b/monitor/tach_sensor.hpp
@@ -170,6 +170,24 @@
     }
 
     /**
+     * @brief Returns true if sensor has a D-Bus owner
+     */
+    inline bool hasOwner() const
+    {
+        return _hasOwner;
+    }
+
+    /**
+     * @brief sets D-Bus owner status
+     *
+     * @param[in] val - new owner status
+     */
+    inline void setOwner(bool val)
+    {
+        _hasOwner = val;
+    }
+
+    /**
      * @brief Returns the factor of the sensor target
      */
     inline double getFactor() const
@@ -178,6 +196,14 @@
     }
 
     /**
+     * @brief Returns a reference to the sensor's Fan object
+     */
+    inline Fan& getFan() const
+    {
+        return _fan;
+    }
+
+    /**
      * @brief Returns the offset of the sensor target
      */
     inline int64_t getOffset() const
@@ -397,6 +423,11 @@
     const bool _hasTarget;
 
     /**
+     * @brief If the sensor has a D-Bus owner
+     */
+    bool _hasOwner = true;
+
+    /**
      * @brief Amount of time to delay updating to functional
      */
     const size_t _funcDelay;