if (!dh->conn) {
dh->conn = _get_bus_private(bus_type);
+ dh->priv = TRUE;
dh->bus_type = bus_type;
if (!dh->conn)
goto err;
return ret;
}
-int gdbus_call_sync_with_reply(const char *dest,
+int gdbus_priv_call_sync_with_reply(dbus_handle_h handle,
+ const char *dest,
const char *path,
const char *iface,
const char *method,
GError *err = NULL;
GVariant *reply = NULL;
int ret = 0;
- dbus_handle_s *dh = NULL;
+ dcl_gdbus();
- if (!dest || !path || !iface || !method) {
- _E("wrong parameters dest(%s) path(%s) iface(%s) method(%s)", dest, path, iface, method);
+ if (!dh) {
+ _E("dbus handle is NULL");
if (param)
g_variant_unref(param);
return -EINVAL;
}
- dh = _gdbus_get_default_connection();
- if (!dh) {
- _E("failed to get default connection, bustype:%d", (int)gdbus_get_default_bus_type());
+ if (!dest || !path || !iface || !method) {
+ _E("wrong parameters dest(%s) path(%s) iface(%s) method(%s)", dest, path, iface, method);
if (param)
g_variant_unref(param);
- return -ECOMM;
+ return -EINVAL;
}
reply = g_dbus_connection_call_sync(dh->conn,
return ret;
}
+int gdbus_call_sync_with_reply(const char *dest,
+ const char *path,
+ const char *iface,
+ const char *method,
+ GVariant *param,
+ GVariant **out_reply)
+{
+ dbus_handle_s *dh = _gdbus_get_default_connection();
+ if (!dh) {
+ _E("failed to get default connection, bustype:%d", (int)gdbus_get_default_bus_type());
+ if (param)
+ g_variant_unref(param);
+ return -ECOMM;
+ }
+
+ return gdbus_priv_call_sync_with_reply(dh,
+ dest,
+ path,
+ iface,
+ method,
+ param,
+ out_reply);
+}
+
int gdbus_call_sync_with_reply_timeout(const char *dest, const char *path,
const char *iface, const char *method, GVariant *param, GVariant **out_reply, int timeout)
{
if (param)
g_variant_unref(param);
return ret;
+
}
int gdbus_call_pairs_async_with_reply(const char *dest,
dbus_handle_h gdbus_get_connection (GBusType bus_type,
gboolean priv);
+int gdbus_free_connection(dbus_handle_h handle);
+
int gdbus_request_name (dbus_handle_h handle,
const char *bus_name,
GBusNameAcquiredCallback acquired_handler,
GVariant *param,
GVariant **out_reply);
+int gdbus_priv_call_sync_with_reply (dbus_handle_h handle,
+ const char *dest,
+ const char *path,
+ const char *iface,
+ const char *method,
+ GVariant *param,
+ GVariant **out_reply);
+
int gdbus_call_sync_with_reply_timeout (const char *dest,
const char *path,
const char *iface,