Documentation only, no functional change
Added copyrights and comments within headers
Resolves openbmc/openbmc#959
Change-Id: If58d78a39fb08251a34a88c2b6340c9fa33d2569
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/tach_sensor.hpp b/tach_sensor.hpp
index b9ac9b3..90d955b 100644
--- a/tach_sensor.hpp
+++ b/tach_sensor.hpp
@@ -12,6 +12,12 @@
namespace presence
{
+/**
+ * @class TachSensor
+ * @brief OpenBMC Tach feedback sensor presence implementation
+ * @details Derived sensor type that uses the tach feedback value to determine
+ * the presence of the fan enclosure that contains this sensor
+ */
class TachSensor : public Sensor
{
public:
@@ -22,6 +28,13 @@
TachSensor& operator=(TachSensor&&) = delete;
~TachSensor() = default;
+ /**
+ * @brief Constructs Tach Sensor Object
+ *
+ * @param[in] bus - Dbus bus object
+ * @param[in] id - ID name of this sensor
+ * @param[in] fanEnc - Reference to the fan enclosure with this sensor
+ */
TachSensor(
sdbusplus::bus::bus& bus,
const std::string& id,
@@ -36,14 +49,29 @@
// Nothing to do here
}
+ /**
+ * @brief Determine the presence of this sensor using the tach feedback
+ *
+ * @return Presence state based on tach feedback
+ */
bool isPresent();
private:
+ /** @brief Connection for sdbusplus bus */
sdbusplus::bus::bus& bus;
+ /** @brief Used to subscribe to dbus signals */
sdbusplus::server::match::match tachSignal;
+ /** @brief Tach speed value given from the signal */
int64_t tach = 0;
- static std::string match(std::string id)
+ /**
+ * @brief Appends the fan sensor id to construct a match string
+ *
+ * @param[in] id - Fan sensor id
+ *
+ * @return Match string to register signal for the fan sensor id
+ */
+ static std::string match(const std::string& id)
{
return std::string("type='signal',"
"interface='org.freedesktop.DBus.Properties',"
@@ -51,11 +79,24 @@
"path='/xyz/openbmc_project/sensors/fan_tach/" +
id + "'");
}
- // Tach signal callback handler
+ /**
+ * @brief Callback function on tach change signals
+ *
+ * @param[out] msg - Data associated with the subscribed signal
+ * @param[out] data - Pointer to this tach sensor object instance
+ * @param[out] err - Contains any sdbus error reference if occurred
+ *
+ * @return 0
+ */
static int handleTachChangeSignal(sd_bus_message* msg,
void* data,
sd_bus_error* err);
-
+ /**
+ * @brief Determine & handle when the signal was a tach change
+ *
+ * @param[in] msg - Expanded sdbusplus message data
+ * @param[in] err - Contains any sdbus error reference if occurred
+ */
void handleTachChange(sdbusplus::message::message& msg,
sd_bus_error* err);