Adding a yielding option callDbusMethod
Currently there are a lot of yielding options that takes in utils.hpp
the ipmi::Context::ptr, but without callDbusMethod,
Now add this method to meet the needs.
Tested:
The callDbusMethod method is called in a library, the compilation is
passed, and the functional test is successful.
Signed-off-by: Albert Zhang <zhanghaodi@inspur.com>
Change-Id: Id46f93708728b4449804ceedfa6d269071e52278
diff --git a/libipmid/utils.cpp b/libipmid/utils.cpp
index 11ae156..a2e4dd2 100644
--- a/libipmid/utils.cpp
+++ b/libipmid/utils.cpp
@@ -616,6 +616,18 @@
return ec;
}
+boost::system::error_code callDbusMethod(Context::ptr ctx,
+ const std::string& service,
+ const std::string& objPath,
+ const std::string& interface,
+ const std::string& method)
+{
+ boost::system::error_code ec;
+ ctx->bus->yield_method_call(ctx->yield, ec, service, objPath, interface,
+ method);
+ return ec;
+}
+
/********* End co-routine yielding alternatives ***************/
ipmi::Cc i2cWriteRead(std::string i2cBus, const uint8_t slaveAddr,