Add associations for pwm
Pwm doesn't inheirt from Sensor as it is special, so
it needs it to be added seperate.
Tested: Saw associations on dbus
Change-Id: I2178e9346dcae845b47a013a2cc15f62e9ed9b31
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/src/PwmSensor.cpp b/src/PwmSensor.cpp
index 047d5ea..b157d52 100644
--- a/src/PwmSensor.cpp
+++ b/src/PwmSensor.cpp
@@ -13,7 +13,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
*/
-#include <PwmSensor.hpp>
+#include "PwmSensor.hpp"
+
+#include "Utils.hpp"
+
#include <fstream>
#include <iostream>
#include <sdbusplus/asio/object_server.hpp>
@@ -22,7 +25,8 @@
static constexpr size_t pwmMin = 0;
PwmSensor::PwmSensor(const std::string& sysPath,
- sdbusplus::asio::object_server& objectServer) :
+ sdbusplus::asio::object_server& objectServer,
+ const std::string& sensorConfiguration) :
sysPath(sysPath),
objectServer(objectServer)
{
@@ -106,6 +110,11 @@
});
sensorInterface->initialize();
controlInterface->initialize();
+
+ association = objectServer.add_interface(
+ "/xyz/openbmc_project/sensors/fan_pwm/" + name,
+ "org.openbmc.Associations");
+ createAssociation(association, sensorConfiguration);
}
PwmSensor::~PwmSensor()
{