From c6a571a45faaa533623993a5e6ea711906fd05b8 Mon Sep 17 00:00:00 2001 From: Tom Joseph Date: Tue, 28 Nov 2017 16:46:22 +0530 Subject: sensor: Modify the service lookup for set sensor command With the current implementation of the generated code for the sensors, the object path corresponding to the sensor is present. But lookup was done again for the object path which was unnecessary. The current change would would only lookup the service implementing the object path and the interface corresponding to the sensor. Change-Id: I185bc49f6387428d62ab0e5cb8326497837aa67f Signed-off-by: Tom Joseph --- sensordatahandler.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sensordatahandler.cpp') diff --git a/sensordatahandler.cpp b/sensordatahandler.cpp index 8240108..3aba53f 100644 --- a/sensordatahandler.cpp +++ b/sensordatahandler.cpp @@ -203,14 +203,12 @@ IpmiUpdateData makeDbusMsg(const std::string& updateInterface, sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()}; using namespace std::string_literals; - std::string dbusService; - std::string dbusPath; + auto dbusService = getService(bus, + sensorInterface, + sensorPath); - std::tie(dbusPath, dbusService) = getServiceAndPath(bus, - sensorInterface, - sensorPath); return bus.new_method_call(dbusService.c_str(), - dbusPath.c_str(), + sensorPath.c_str(), updateInterface.c_str(), command.c_str()); } -- cgit v1.2.1