本文整理汇总了C++中dbus_pending_call_steal_reply函数的典型用法代码示例。如果您正苦于以下问题:C++ dbus_pending_call_steal_reply函数的具体用法?C++ dbus_pending_call_steal_reply怎么用?C++ dbus_pending_call_steal_reply使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dbus_pending_call_steal_reply函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: create_config_reply
static void create_config_reply(DBusPendingCall *call, void *user_data)
{
DBusMessage *reply = dbus_pending_call_steal_reply(call);
const char *path;
DBG("");
if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) {
connman_error("Failed to create proxy configuration");
goto done;
}
if (dbus_message_get_args(reply, NULL, DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_INVALID) == FALSE)
goto done;
g_free(current_config);
current_config = g_strdup(path);
done:
dbus_message_unref(reply);
}
开发者ID:aldebaran,项目名称:connman-stable,代码行数:22,代码来源:pacrunner.c
示例2: dbus_func_args_async_callback
void dbus_func_args_async_callback(DBusPendingCall *call, void *data) {
dbus_async_call_t *req = (dbus_async_call_t *)data;
DBusMessage *msg;
/* This is guaranteed to be non-NULL, because this function is called only
when once the remote method invokation returns. */
msg = dbus_pending_call_steal_reply(call);
if (msg) {
if (req->user_cb) {
// The user may not deref the message object.
req->user_cb(msg, req->user);
}
dbus_message_unref(msg);
}
//dbus_message_unref(req->method);
dbus_pending_call_cancel(call);
dbus_pending_call_unref(call);
free(req);
}
开发者ID:sjnewbury,项目名称:fennec-qt-maemo5,代码行数:22,代码来源:DBusUtils.cpp
示例3: get_active_cb
static void
get_active_cb(DBusPendingCall *pending, void *data)
{
struct launcher_logind *wl = data;
DBusMessageIter iter;
DBusMessage *m;
int type;
dbus_pending_call_unref(wl->pending_active);
wl->pending_active = NULL;
m = dbus_pending_call_steal_reply(pending);
if (!m)
return;
type = dbus_message_get_type(m);
if (type == DBUS_MESSAGE_TYPE_METHOD_RETURN &&
dbus_message_iter_init(m, &iter))
parse_active(wl, m, &iter);
dbus_message_unref(m);
}
开发者ID:ChristophHaag,项目名称:weston,代码行数:22,代码来源:launcher-logind.c
示例4: systemui_ack_cb
static void
systemui_ack_cb(DBusPendingCall *pending, void *user_data)
{
DBusMessage *rsp = dbus_pending_call_steal_reply(pending);
if( rsp != 0 )
{
DBusError err = DBUS_ERROR_INIT;
dbus_int32_t *vec = 0;
int cnt = 0;
switch( dbus_message_get_type(rsp) )
{
case DBUS_MESSAGE_TYPE_METHOD_RETURN:
if( dbus_message_get_args(rsp, &err,
DBUS_TYPE_ARRAY,
DBUS_TYPE_INT32, &vec, &cnt,
DBUS_TYPE_INVALID) )
{
if( systemui_ack_callback != 0 )
{
systemui_ack_callback(vec, cnt);
}
}
if( dbus_error_is_set(&err) )
{
log_error_F("%s: %s\n", err.name, err.message);
}
break;
case DBUS_MESSAGE_TYPE_ERROR:
// TODO: handle system ui not up
break;
}
dbus_error_free(&err);
dbus_message_unref(rsp);
}
}
开发者ID:tidatida,项目名称:alarmd,代码行数:39,代码来源:ipc_systemui.c
示例5: new_conn_reply
static void new_conn_reply(DBusPendingCall *call, void *user_data)
{
struct ext_io *conn = user_data;
struct ext_profile *ext = conn->ext;
DBusMessage *reply = dbus_pending_call_steal_reply(call);
DBusError err;
dbus_error_init(&err);
dbus_set_error_from_message(&err, reply);
dbus_message_unref(reply);
dbus_pending_call_unref(conn->new_conn);
conn->new_conn = NULL;
if (!dbus_error_is_set(&err)) {
if (conn->cb) {
conn->cb(&ext->p, conn->device, 0);
conn->cb = NULL;
}
return;
}
error("%s replied with an error: %s, %s", ext->name,
err.name, err.message);
if (conn->cb) {
conn->cb(&ext->p, conn->device, -ECONNREFUSED);
conn->cb = NULL;
}
if (dbus_error_has_name(&err, DBUS_ERROR_NO_REPLY))
ext_cancel(ext);
dbus_error_free(&err);
ext->conns = g_slist_remove(ext->conns, conn);
ext_io_destroy(conn);
}
开发者ID:intgr,项目名称:bluez,代码行数:39,代码来源:profile.c
示例6: mode_request_reply
static void mode_request_reply(DBusPendingCall *call, void *user_data)
{
struct obex_server *server = user_data;
DBusMessage *reply = dbus_pending_call_steal_reply(call);
DBusError derr;
dbus_error_init(&derr);
if (dbus_set_error_from_message(&derr, reply)) {
error("usb: Replied with an error: %s, %s",
derr.name, derr.message);
dbus_error_free(&derr);
} else {
const char *mode;
dbus_message_get_args(reply, NULL,
DBUS_TYPE_STRING, &mode,
DBUS_TYPE_INVALID);
usb_set_mode(server, mode);
}
dbus_message_unref(reply);
}
开发者ID:hmallat,项目名称:obexd,代码行数:22,代码来源:usb.c
示例7: session_request_reply
static void session_request_reply(DBusPendingCall *call, gpointer user_data)
{
struct pending_data *pending = user_data;
struct obc_session *session = pending->session;
DBusMessage *reply = dbus_pending_call_steal_reply(call);
const char *name;
DBusError derr;
dbus_error_init(&derr);
if (dbus_set_error_from_message(&derr, reply)) {
GError *gerr = NULL;
error("Replied with an error: %s, %s",
derr.name, derr.message);
dbus_error_free(&derr);
dbus_message_unref(reply);
g_set_error(&gerr, OBEX_IO_ERROR, -ECANCELED, "%s",
derr.message);
session_terminate_transfer(session, pending->transfer, gerr);
g_clear_error(&gerr);
return;
}
dbus_message_get_args(reply, NULL,
DBUS_TYPE_STRING, &name,
DBUS_TYPE_INVALID);
DBG("Agent.Request() reply: %s", name);
if (strlen(name))
obc_transfer_set_name(pending->transfer, name);
pending->cb(session, NULL, pending->transfer);
dbus_message_unref(reply);
return;
}
开发者ID:KpuBopy4ka,项目名称:obexd-map,代码行数:39,代码来源:session.c
示例8: connect_cb
static void connect_cb(DBusPendingCall *call, void *user_data)
{
struct synce_context *context = user_data;
DBusConnection *conn;
DBusMessage *reply;
DBusError err;
char *path;
conn = context->dbus_conn;
reply = dbus_pending_call_steal_reply(call);
dbus_error_init(&err);
if (dbus_message_get_args(reply, &err, DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_INVALID) == FALSE) {
error("%s", err.message);
dbus_error_free(&err);
goto failed;
}
DBG("Got conn object %s from syncevolution", path);
context->conn_obj = g_strdup(path);
context->reply_watch = g_dbus_add_signal_watch(conn, NULL, path,
SYNCE_CONN_INTERFACE, "Reply",
reply_signal, context, NULL);
context->abort_watch = g_dbus_add_signal_watch(conn, NULL, path,
SYNCE_CONN_INTERFACE, "Abort",
abort_signal, context, NULL);
dbus_message_unref(reply);
return;
failed:
obex_object_set_io_flags(context, G_IO_ERR, -EPERM);
context->lasterr = -EPERM;
}
开发者ID:Commers,项目名称:obexd,代码行数:39,代码来源:syncevolution.c
示例9: dbus_call_method
int dbus_call_method(DBusConnection* dbus_connection, const char* bus_name,
const char* path, const char* iface, const char* method,
char** params, char** ret)
{
DBusMessage *message;
DBusMessageIter args;
DBusPendingCall* pending;
int param_index, param_count = sizeof(params) / sizeof(char*);
message = dbus_message_new_method_call(
bus_name,
path,
iface,
method);
dbus_message_iter_init_append(message, &args);
for (param_index = 0; param_index < param_count; param_index++) {
dbus_message_iter_append_basic(
&args, DBUS_TYPE_STRING,
¶ms[param_index]);
}
dbus_connection_send_with_reply(dbus_connection, message, &pending, -1);
dbus_connection_flush(dbus_connection);
dbus_message_unref(message);
dbus_pending_call_block(pending);
if (ret) message = dbus_pending_call_steal_reply(pending);
dbus_pending_call_unref(pending);
if (ret) {
dbus_message_iter_init(message, &args);
dbus_message_iter_get_basic(&args, ret);
dbus_message_unref(message);
}
return RET_OK;
}
开发者ID:rouxcorp,项目名称:pam_ldapjpeg,代码行数:38,代码来源:dbus-client.c
示例10: cb_pending
static void
cb_pending(DBusPendingCall *dbus_pending, void *user_data)
{
Eldbus_Message *msg;
Eldbus_Pending *pending = user_data;
if (!dbus_pending_call_get_completed(dbus_pending))
{
INF("timeout to pending %p", pending);
dbus_pending_call_cancel(dbus_pending);
msg = eldbus_message_error_new(pending->msg_sent,
ELDBUS_ERROR_PENDING_TIMEOUT,
"This call was not completed in time.");
eldbus_pending_dispatch(pending, msg);
return;
}
msg = eldbus_message_new(EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN(msg);
msg->dbus_msg = dbus_pending_call_steal_reply(dbus_pending);
if (!msg->dbus_msg)
{
EINA_SAFETY_ON_NULL_GOTO(pending->cb, cleanup);
msg->dbus_msg = dbus_message_new_error(NULL,
"org.enlightenment.DBus.NoReply",
"There was no reply to this method call.");
EINA_SAFETY_ON_NULL_GOTO(msg->dbus_msg, cleanup);
}
dbus_message_iter_init(msg->dbus_msg, &msg->iterator->dbus_iterator);
eldbus_pending_dispatch(pending, msg);
return;
cleanup:
eldbus_message_unref(msg);
}
开发者ID:FlorentRevest,项目名称:EFL,代码行数:38,代码来源:eldbus_pending.c
示例11: systemui_ack_close
static void
systemui_ack_close(DBusPendingCall *pending, void *user_data)
{
cookie_t cookie = (cookie_t)user_data;
int result = 0;
DBusMessage *rsp = dbus_pending_call_steal_reply(pending);
if( rsp != 0 )
{
DBusError err = DBUS_ERROR_INIT;
dbus_int32_t ack = 0;
switch( dbus_message_get_type(rsp) )
{
case DBUS_MESSAGE_TYPE_METHOD_RETURN:
if( dbus_message_get_args(rsp, &err,
DBUS_TYPE_INT32, &ack,
DBUS_TYPE_INVALID) )
{
result = ack;
}
if( dbus_error_is_set(&err) )
{
log_error_F("%s: %s\n", err.name, err.message);
}
break;
case DBUS_MESSAGE_TYPE_ERROR:
// TODO: handle system ui not up
break;
}
dbus_error_free(&err);
dbus_message_unref(rsp);
}
log_debug_F("%ld -> %s\n", (long)cookie, (result>0) ? "ACK" : "NAK");
}
开发者ID:tidatida,项目名称:alarmd,代码行数:38,代码来源:ipc_systemui.c
示例12: loader_needed_cb
static void loader_needed_cb(DBusPendingCall *pending, void *user_data)
{
(void)user_data;
DBusMessage *rsp = 0;
DBusError err = DBUS_ERROR_INIT;
if (!(rsp = dbus_pending_call_steal_reply(pending)))
goto cleanup;
if (dbus_set_error_from_message(&err, rsp)) {
dsme_log(LOG_DEBUG, "wlanloader: disabled, GetUnit: %s: %s",
err.name, err.message);
} else {
/* We got the reply without error, so the service exists */
dsme_dbus_bind_signals(&bound, signals);
dsme_log(LOG_DEBUG, "wlanloader: activated");
}
cleanup:
if (rsp) dbus_message_unref(rsp);
dbus_error_free(&err);
}
开发者ID:faenil,项目名称:dsme,代码行数:23,代码来源:wlanloader.c
示例13: object_destroyed
/* Don't be bothered by the fact that this function is almost exactly
* the same as object_created(). The little difference is that it
* gives the callback the objectid on error too. */
static void object_destroyed(DBusPendingCall *pendelum, RequestReplyInfo *info)
{
GError *error;
DBusMessage *reply;
reply = dbus_pending_call_steal_reply(pendelum);
if (!(error = mafw_dbus_is_error(reply, MAFW_SOURCE_ERROR))) {
g_assert(dbus_message_get_type(reply) ==
DBUS_MESSAGE_TYPE_METHOD_RETURN);
if (info->object_destroyed_cb)
info->object_destroyed_cb(info->src,
info->objectid,
info->cbdata, NULL);
} else {
if (info->object_destroyed_cb)
info->object_destroyed_cb(info->src,
info->objectid,
info->cbdata, error);
g_error_free(error);
}
dbus_message_unref(reply);
dbus_pending_call_unref(pendelum);
}
开发者ID:community-ssu,项目名称:mafw,代码行数:26,代码来源:mafw-proxy-source.c
示例14: register_agent_cb
static void register_agent_cb(DBusPendingCall *pending, void *user_data)
{
DBusMessage *reply;
if (dbus_pending_call_get_completed(pending) == FALSE)
return;
register_call = NULL;
reply = dbus_pending_call_steal_reply(pending);
if (reply == NULL)
goto out;
if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) {
g_dbus_unregister_interface(connection,
AGENT_PATH, NEARD_AGENT_INTERFACE);
} else
agent_registered = TRUE;
dbus_message_unref(reply);
out:
dbus_pending_call_unref(pending);
}
开发者ID:Jubei-Mitsuyoshi,项目名称:aaa-connman,代码行数:23,代码来源:neard.c
示例15: method_call_reply
static void method_call_reply(DBusPendingCall *call, void *user_data)
{
struct method_call_data *data = user_data;
DBusMessage *reply;
DBusMessageIter iter;
const char *error;
reply = dbus_pending_call_steal_reply(call);
if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
error = dbus_message_get_error_name(reply);
else
error = NULL;
dbus_message_iter_init(reply, &iter);
if (data->function != NULL)
data->function(error, &iter, data->user_data);
dbus_message_unref(reply);
dbus_pending_call_unref(call);
}
开发者ID:Jubei-Mitsuyoshi,项目名称:aaa-connman,代码行数:23,代码来源:dbus.c
示例16: FcitxNotifyCallback
static void
FcitxNotifyCallback(DBusPendingCall *call, void *data)
{
FcitxNotifyItem *item = (FcitxNotifyItem*)data;
if (item->global_id)
return;
FcitxNotify *notify = item->owner;
DBusMessage *msg = dbus_pending_call_steal_reply(call);
if (msg) {
uint32_t id;
DBusError error;
dbus_error_init(&error);
dbus_message_get_args(msg, &error, DBUS_TYPE_UINT32,
&id , DBUS_TYPE_INVALID);
dbus_message_unref(msg);
dbus_error_free(&error);
item->global_id = id;
FcitxNotifyItemAddGlobal(notify, item);
if (item->state == NOTIFY_TO_BE_REMOVE) {
_FcitxNotifyCloseNotification(notify, item);
}
}
}
开发者ID:yuyichao,项目名称:fcitx,代码行数:23,代码来源:freedesktop-notify.c
示例17: DBus_CallResult
void DBus_CallResult(DBusPendingCall *pending, void *data)
{
DBusMessage *msg;
Tcl_CallData *dataPtr = data;
Tcl_DBusEvent *evPtr;
msg = dbus_pending_call_steal_reply(pending);
/* free the pending message handle */
dbus_pending_call_unref(pending);
/* Allocate a DBus event structure and copy in some basic data */
evPtr = (Tcl_DBusEvent *) ckalloc(sizeof(Tcl_DBusEvent));
evPtr->interp = dataPtr->interp;
evPtr->script = dataPtr->script;
evPtr->conn = dataPtr->conn;
/* Fill in the rest of the DBus event structure */
evPtr->event.proc = DBus_EventHandler;
evPtr->msg = msg;
/* Don't send a reply on the reply */
evPtr->flags = dataPtr->flags | DBUSFLAG_NOREPLY;
Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL);
/* Free the DBus handler data structure */
ckfree(data);
}
开发者ID:recri,项目名称:keyer,代码行数:23,代码来源:dbusEvent.c
示例18: method_callback
void method_callback(DBusPendingCall* pending){
dbus_bool_t stat;
dbus_uint32_t level;
DBusMessage* msg;
DBusMessageIter args;
DBusMessageIter list;
DBusError error;
char** service_list;
char* stuff;
int service_list_len, i;
dbus_error_init (&error);
// block until we receive a reply
dbus_pending_call_block(pending);
// get the reply message
msg = dbus_pending_call_steal_reply(pending);
if (NULL == msg) {
fprintf(stderr, "Reply Null\n");
exit(1);
}
// free the pending message handle
dbus_pending_call_unref(pending);
/* Extract the data from the reply */
if (!dbus_message_get_args (msg, &error,
DBUS_TYPE_STRING, &service_list,
DBUS_TYPE_INVALID )) {
fprintf (stderr, "Failed to complete 71 get_args call: %s\n", error.message);
exit (1);
}
printf("Got Reply: \n%s\n", service_list);
// free reply and close connection
dbus_message_unref(msg);
}
开发者ID:AvengerMoJo,项目名称:PushServer,代码行数:37,代码来源:rbus-call-name-test.c
示例19: dc_render_node_create
int dc_render_node_create(struct razer_daemon_controller *controller,int effect_uid,char *name,char *description)
{
DBusMessage *msg;
DBusMessageIter args;
msg = dbus_message_new_method_call("org.voyagerproject.razer.daemon","/","org.voyagerproject.razer.daemon.render_node","create");
if(!msg)
dc_error_close(controller,"Error creating Message\n");
dbus_message_iter_init_append(msg,&args);
if(!dbus_message_iter_append_basic(&args,DBUS_TYPE_INT32,&effect_uid))
dc_error_close(controller,"Out of memory!\n");
if(!dbus_message_iter_append_basic(&args,DBUS_TYPE_STRING,&name))
dc_error_close(controller,"Out of memory!\n");
if(!dbus_message_iter_append_basic(&args,DBUS_TYPE_STRING,&description))
dc_error_close(controller,"Out of memory!\n");
if(!dbus_connection_send_with_reply(controller->dbus,msg,&controller->pending,-1))
dc_error_close(controller,"Out of memory!\n");
if(!controller->pending)
dc_error_close(controller,"No pending call\n");
dbus_connection_flush(controller->dbus);
dbus_message_unref(msg);
int render_node_uid = -1;
dbus_pending_call_block(controller->pending);
msg = dbus_pending_call_steal_reply(controller->pending);
if(!msg)
dc_error_close(controller,"Empty reply\n");
dbus_pending_call_unref(controller->pending);
if(!dbus_message_iter_init(msg,&args))
dc_error_close(controller,"Message has no arguments!\n");
else if(dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_INT32)
dc_error_close(controller,"Argument is not an int!\n");
else
dbus_message_iter_get_basic(&args,&render_node_uid);
dbus_message_unref(msg);
return(render_node_uid);
}
开发者ID:SublimeApple,项目名称:razer_blackwidow_chroma_driver,代码行数:37,代码来源:razer_daemon_controller.c
示例20: dbus_message_new_method_call
char *dc_fx_list(struct razer_daemon_controller *controller)
{
DBusMessage *msg;
DBusMessageIter args;
msg = dbus_message_new_method_call("org.voyagerproject.razer.daemon","/","org.voyagerproject.razer.daemon.fx","list");
if(!msg)
dc_error_close(controller,"Error creating Message\n");
if(!dbus_connection_send_with_reply(controller->dbus,msg,&controller->pending,-1))
dc_error_close(controller,"Out of memory!\n");
if(!controller->pending)
dc_error_close(controller,"No pending call\n");
dbus_connection_flush(controller->dbus);
dbus_message_unref(msg);
char *list = NULL;
dbus_pending_call_block(controller->pending);
msg = dbus_pending_call_steal_reply(controller->pending);
if(!msg)
dc_error_close(controller,"Empty reply\n");
dbus_pending_call_unref(controller->pending);
if(!dbus_message_iter_init(msg,&args))
dc_error_close(controller,"Message has no arguments!\n");
else if(dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
dc_error_close(controller,"Argument is not a string!\n");
else
dbus_message_iter_get_basic(&args,&list);
//if(!dbus_message_iter_next(&args))
// dc_error_close(controller,"Message has too few arguments!\n");
//else if(dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_UINT32)
// dc_error_close(controller,"Argument is not int!\n");
//else
// dbus_message_iter_get_basic(&args,&level);
//printf("fx List: %s\n",list);
dbus_message_unref(msg);
return(list);
}
开发者ID:SublimeApple,项目名称:razer_blackwidow_chroma_driver,代码行数:37,代码来源:razer_daemon_controller.c
注:本文中的dbus_pending_call_steal_reply函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论