}
DbusConnection::SubscriptionId DbusConnection::signalSubscribe(const SignalCallback& callback,
- const std::string& senderBusName)
+ const std::string& senderBusName,
+ const std::string& interface,
+ const std::string& objectPath,
+ const std::string& member)
{
return g_dbus_connection_signal_subscribe(mConnection,
senderBusName.empty() ? NULL : senderBusName.c_str(),
- NULL,
- NULL,
- NULL,
+ interface.empty() ? NULL : interface.c_str(),
+ objectPath.empty() ? NULL : objectPath.c_str(),
+ member.empty() ? NULL : member.c_str(),
NULL,
G_DBUS_SIGNAL_FLAGS_NONE,
&DbusConnection::onSignal,
* Empty sender means subscribe to all signals
* Returns a subscription identifier that can be used to unsubscribe signal
*/
- SubscriptionId signalSubscribe(const SignalCallback& callback, const std::string& senderBusName);
+ SubscriptionId signalSubscribe(const SignalCallback& callback,
+ const std::string& senderBusName = "",
+ const std::string& interface = "",
+ const std::string& objectPath ="",
+ const std::string& member = "");
/**
* Unsubscribes from a signal.
mSubscriptionId = mDbusConnection->signalSubscribe(std::bind(&HostDbusConnection::onSignalCall,
this, _1, _2, _3, _4, _5),
- std::string());
+ std::string(),
+ api::dbus::INTERFACE);
LOGD("Connected");
}