void hd_utils_open_link (const gchar *link) { DBusConnection *conn = NULL; DBusMessage *msg = NULL; g_debug ("%s: opening %s", __FUNCTION__, link); conn = dbus_bus_get (DBUS_BUS_SESSION, NULL); if (!conn) { g_critical ("%s: Couldn't connect to session bus", __FUNCTION__); return; } msg = dbus_message_new_method_call (DBUS_BROWSER_SERVICE, DBUS_BROWSER_PATH, DBUS_BROWSER_SERVICE, DBUS_BROWSER_METHOD); if (!msg) return; dbus_message_set_auto_start (msg, TRUE); dbus_message_set_no_reply (msg, TRUE); dbus_message_append_args (msg, DBUS_TYPE_STRING, &link, DBUS_TYPE_INVALID); dbus_connection_send (conn, msg, NULL); dbus_message_unref (msg); }
static void send_no_return_values (DBusConnection *connection, DBusMessage *msg, DBusError *error) { if (error) { /* Block to check success codepath */ DBusMessage *reply; reply = dbus_connection_send_with_reply_and_block (connection, msg, -1, error); if (reply == NULL) _DBUS_ASSERT_ERROR_IS_SET (error); else dbus_message_unref (reply); } else { /* Silently-fail nonblocking codepath */ dbus_message_set_no_reply (msg, TRUE); dbus_connection_send (connection, msg, NULL); } }
gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message) { dbus_bool_t result = FALSE; if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL) dbus_message_set_no_reply(message, TRUE); else if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_SIGNAL) { const char *path = dbus_message_get_path(message); const char *interface = dbus_message_get_interface(message); const char *name = dbus_message_get_member(message); const GDBusArgInfo *args; if (!check_signal(connection, path, interface, name, &args)) goto out; } /* Flush pending signal to guarantee message order */ g_dbus_flush(connection); result = dbus_connection_send(connection, message, NULL); out: dbus_message_unref(message); return result; }
static void release_agent(struct passkey_agent *agent) { DBusMessage *message; debug("Releasing agent %s, %s", agent->name, agent->path); message = dbus_message_new_method_call(agent->name, agent->path, "org.bluez.PasskeyAgent", "Release"); if (message == NULL) { error("Couldn't allocate D-Bus message"); return; } dbus_message_set_no_reply(message, TRUE); send_message_and_unref(agent->conn, message); if (agent == default_agent) name_listener_remove(agent->conn, agent->name, (name_cb_t) default_agent_exited, NULL); else { struct passkey_agent ref; /* Only remove the name listener if there are no more agents for this name */ memset(&ref, 0, sizeof(ref)); ref.name = agent->name; if (!g_slist_find_custom(agent->adapter->passkey_agents, &ref, (GCompareFunc) agent_cmp)) name_listener_remove(agent->conn, ref.name, (name_cb_t) agent_exited, agent->adapter); } }
void hd_utils_launch_task (const gchar *id) { DBusConnection *conn = NULL; DBusMessage *msg = NULL; g_debug ("%s: launching %s", __FUNCTION__, id); conn = dbus_bus_get (DBUS_BUS_SESSION, NULL); if (!conn) { g_critical ("%s: Couldn't connect to session bus", __FUNCTION__); return; } msg = dbus_message_new_method_call (APP_MGR_DBUS_NAME, APP_MGR_DBUS_PATH, APP_MGR_DBUS_NAME, APP_MGR_LAUNCH_APPLICATION); if (!msg) return; dbus_message_set_no_reply (msg, TRUE); dbus_message_append_args (msg, DBUS_TYPE_STRING, &id, DBUS_TYPE_INVALID); dbus_connection_send (conn, msg, NULL); dbus_message_unref (msg); }
void asdbus_EndSessionOk () { show_debug(__FILE__, __FUNCTION__, __LINE__, "dbus EndSessionOk"); #ifdef HAVE_DBUS_CONTEXT if (ASDBus.session_conn) { DBusMessage *message = dbus_message_new_method_call (SESSIONMANAGER_NAME, ASDBus.gnomeSessionPath, /*"/org/gnome/SessionManager", */ IFACE_SESSION_PRIVATE, "EndSessionResponse"); show_debug(__FILE__, __FUNCTION__, __LINE__, "dbus EndSessionResponse to iface = \"%s\", path = \"%s\", manager = \"%s\"", IFACE_SESSION_PRIVATE, ASDBus.gnomeSessionPath, SESSIONMANAGER_NAME); if (message) { DBusMessageIter iter; char *reason = ""; dbus_bool_t ok = 1; dbus_uint32_t msg_serial; dbus_message_iter_init_append (message, &iter); dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &ok); dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &reason); dbus_message_set_no_reply (message, TRUE); if (!dbus_connection_send (ASDBus.session_conn, message, &msg_serial)) show_error ("Failed to send EndSession indicator."); else show_progress ("Sent Ok to end session (time, %ld).", time (NULL)); dbus_message_unref (message); } } #endif }
bool send_dummy_msg(DBusConnection *conn) { DBusMessage *message = NULL; DBusMessageIter iter; int a; message = dbus_message_new_method_call(dbus_bus_get_unique_name(conn), "/org/linuxcontainers/cgmanager", "org.linuxcontainers.cgmanager0_0", "Ping"); if (!message) { nih_error("%s: failed to create ping message", __func__); return false; } dbus_message_set_no_reply(message, TRUE); dbus_message_iter_init_append(message, &iter); if (! dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &a)) { dbus_message_unref(message); nih_error("%s: out of memory", __func__); return false; } dbus_connection_send(conn, message, NULL); dbus_connection_flush(conn); dbus_message_unref(message); return true; }
PendingCall StubBase::send_request(const char* method_name, std::function<void(DBusMessageIter&)>&& f, bool is_oneway) { message_ptr_t msg = make_message(dbus_message_new_method_call(busname().c_str(), objectpath(), iface(), method_name)); DBusPendingCall* pending = nullptr; DBusMessageIter iter; dbus_message_iter_init_append(msg.get(), &iter); f(iter); if (!is_oneway) { int timeout = disp().request_timeout(); if (detail::request_specific_timeout.count() > 0) timeout = detail::request_specific_timeout.count(); dbus_connection_send_with_reply(disp().conn_, msg.get(), &pending, timeout); } else { // otherwise server would stop reading requests after a while dbus_message_set_no_reply(msg.get(), TRUE); dbus_connection_send(disp().conn_, msg.get(), nullptr); dbus_connection_flush(disp().conn_); } detail::request_specific_timeout = std::chrono::milliseconds(0); return PendingCall(dbus_message_get_serial(msg.get()), pending); }
static void send_cancel_request(struct pending_agent_request *req) { DBusMessage *message; char address[18], *ptr = address; message = dbus_message_new_method_call(req->agent->name, req->agent->path, "org.bluez.PasskeyAgent", "Cancel"); if (message == NULL) { error("Couldn't allocate D-Bus message"); return; } ba2str(&req->bda, address); dbus_message_append_args(message, DBUS_TYPE_STRING, &req->path, DBUS_TYPE_STRING, &ptr, DBUS_TYPE_INVALID); dbus_message_set_no_reply(message, TRUE); send_message_and_unref(req->agent->conn, message); debug("PasskeyAgent.Request(%s, %s) was canceled", req->path, address); dbus_pending_call_cancel(req->call); dbus_pending_call_unref(req->call); g_free(req->pin); g_free(req->path); g_free(req); }
void __connman_agent_cleanup(void) { DBusMessage *message; DBG(""); if (connection == NULL) return; if (agent_watch > 0) g_dbus_remove_watch(connection, agent_watch); if (agent_path == NULL) return; message = dbus_message_new_method_call(agent_sender, agent_path, CONNMAN_AGENT_INTERFACE, "Release"); if (message == NULL) return; dbus_message_set_no_reply(message, TRUE); g_dbus_send_message(connection, message); agent_free(); dbus_connection_unref(connection); }
static Bool asdbus_LogoutKDE (KDE_ShutdownConfirm confirm, KDE_ShutdownMode mode, KDE_ShutdownType type, int timeout) { Bool requested = False; #ifdef HAVE_DBUS_CONTEXT if (ASDBus.session_conn) { DBusMessage *message = dbus_message_new_method_call (KSMSERVER_NAME, KSMSERVER_PATH, KSMSERVER_INTERFACE, "logout"); if (message) { DBusMessageIter iter; dbus_uint32_t msg_serial; dbus_int32_t i32_confirm = confirm; dbus_int32_t i32_mode = mode; dbus_int32_t i32_type = type; dbus_message_iter_init_append (message, &iter); dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &i32_confirm); dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &i32_mode); dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &i32_type); dbus_message_set_no_reply (message, TRUE); if (!dbus_connection_send (ASDBus.session_conn, message, &msg_serial)) show_error ("Failed to send Logout request to KDE."); else { requested = True; show_progress ("Sent Ok to end session (time, %ld).", time (NULL)); } dbus_message_unref (message); } } #endif return requested; }
static void session_notify_complete(struct session_data *session, struct transfer_data *transfer) { struct agent_data *agent = session->agent; DBusMessage *message; if (agent == NULL || transfer->path == NULL) goto done; message = dbus_message_new_method_call(agent->name, agent->path, AGENT_INTERFACE, "Complete"); if (message == NULL) return; dbus_message_set_no_reply(message, TRUE); dbus_message_append_args(message, DBUS_TYPE_OBJECT_PATH, &transfer->path, DBUS_TYPE_INVALID); g_dbus_send_message(session->conn, message); done: DBG("Transfer(%p) complete", transfer); session_terminate_transfer(session, transfer, NULL); }
static int ldbus_message_set_no_reply(lua_State *L) { DBusMessage *message = check_DBusMessage(L, 1); int no_reply = (luaL_checktype(L, 2, LUA_TBOOLEAN), lua_toboolean(L, 2)); dbus_message_set_no_reply(message, no_reply); return 0; }
int bind_dbus_message_set_no_reply( lua_State * const _L) { utils_check_nargs( _L, 2); DBusMessage * const message = cast_to_dbus_message( _L, 1); int const autostart = lua_toboolean( _L, 2); dbus_message_set_no_reply( message, autostart); return 0; }
int main(int argc, char** argv) { DBusConnection* bus = NULL; DBusMessage* msg = NULL; DBusError error; DBusPendingCall* pending; dbus_error_init(&error); printf("Connecting to Session D-Bus\n"); bus = dbus_bus_get(DBUS_BUS_SESSION, &error); terminateOnError("Failed to open Session bus\n", &error); assert(bus != NULL); printf("Creating a message object\n"); msg = dbus_message_new_method_call( NOTIFY_TARGET, NOTIFY_OBJ_PATH, NOTIFY_INTERFACE, NOTIFY_METHOD); assert(msg != NULL); printf("Appending arguments to the message\n"); fillArgs(msg); #ifndef WAIT_FOR_REPLY dbus_message_set_no_reply(msg, TRUE); printf("Adding message to client send-queue\n"); dbus_connection_send(bus, msg, NULL); printf("Waiting for send-queue to be send out\n"); dbus_connection_flush(bus); printf("Cleaning up message\n"); dbus_message_unref(msg); #else printf("Adding message to client send-queue\n"); dbus_connection_send_with_reply(bus, msg, &pending, -1); printf("Waiting for send-queue to be send out\n"); dbus_connection_flush(bus); printf("Cleaning up message\n"); dbus_message_unref(msg); recvReply(pending); #endif printf("Cleaning up connection\n"); dbus_connection_unref(bus); return 0; }
/** * Generic function to send D-Bus messages and signals * to send a signal, call dbus_send with service == NULL * * @todo Make it possible to send D-Bus replies as well * * @param service D-Bus service; for signals, set to NULL * @param path D-Bus path * @param interface D-Bus interface * @param name The D-Bus method or signal name to send to * @param callback A reply callback, or NULL to set no reply; * for signals, this is unused, but please use NULL * for consistency * @param first_arg_type The DBUS_TYPE of the first argument in the list * @param ... The arguments to append to the D-Bus message; * terminate with DBUS_TYPE_INVALID * Note: the arguments MUST be passed by reference * @return TRUE on success, FALSE on failure */ gboolean dbus_send(const gchar *const service, const gchar *const path, const gchar *const interface, const gchar *const name, DBusPendingCallNotifyFunction callback, int first_arg_type, ...) { DBusMessage *msg; gboolean status = FALSE; va_list var_args; if (service != NULL) { msg = dbus_new_method_call(service, path, interface, name); if (callback == NULL) dbus_message_set_no_reply(msg, TRUE); } else { if (callback != NULL) { mce_log(LL_ERR, "Programmer snafu! " "dbus_send() called with a DBusPending " "callback for a signal. Whoopsie!"); callback = NULL; } msg = dbus_new_signal(path, interface, name); } /* Append the arguments, if any */ va_start(var_args, first_arg_type); if (first_arg_type != DBUS_TYPE_INVALID) { if (dbus_message_append_args_valist(msg, first_arg_type, var_args) == FALSE) { mce_log(LL_CRIT, "Failed to append arguments to D-Bus message " "for %s.%s", interface, name); dbus_message_unref(msg); goto EXIT; } } /* Send the signal / call the method */ if (callback == NULL) { status = dbus_send_message(msg); } else { status = dbus_send_message_with_reply_handler(msg, callback); } EXIT: va_end(var_args); return status; }
dbus_bool_t dbus_send_message(DBusConnection *connection, DBusMessage *message) { dbus_bool_t result = FALSE; if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL) dbus_message_set_no_reply(message, TRUE); result = dbus_connection_send(connection, message, NULL); dbus_message_unref(message); return result; }
static DBusMessage * build_reply_from_jsval(SeedContext ctx, const char *signature, const char *sender, dbus_uint32_t serial, SeedValue rval, SeedException *exception) { DBusMessage *reply; DBusMessageIter arg_iter; DBusSignatureIter sig_iter; gboolean marshalled = FALSE; reply = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN); dbus_message_set_destination(reply, sender); dbus_message_set_reply_serial(reply, serial); dbus_message_set_no_reply(reply, TRUE); dbus_message_iter_init_append(reply, &arg_iter); if (seed_value_is_undefined (ctx, rval) || g_str_equal(signature, "")) { /* We don't want to send anything in these cases so skip the * marshalling altogether. */ return reply; } dbus_signature_iter_init(&sig_iter, signature); if (signature_has_one_element(signature)) { marshalled = seed_js_one_value_to_dbus(ctx, rval, &arg_iter, &sig_iter, exception); } else { if (!seed_value_is_object (ctx, rval)) { g_warning("Signature has multiple items but return value is not an array"); return reply; } marshalled = seed_js_values_to_dbus(ctx, 0, rval, &arg_iter, &sig_iter, exception); } if (!marshalled) { /* replace our planned reply with an error */ dbus_message_unref(reply); if (!dbus_reply_from_exception_and_sender(ctx, sender, serial, &reply, exception)) g_warning ("conversion of dbus return value failed but no exception was set?"); } return reply; }
void GMAppStatusNotify::show() { DBusMessage * msg; FXuint serialid; if (dbus_bus_name_has_owner(SESSIONBUS,APPLICATION_STATUS_NAME,NULL)) { if ((msg = method("RegisterStatusNotifierItem"))!=NULL){ const FXchar * cname = name.text(); dbus_message_set_no_reply(msg,true); dbus_message_append_args(msg,DBUS_TYPE_STRING,&cname,DBUS_TYPE_INVALID); dbus_connection_send(SESSIONBUS,msg,&serialid); dbus_message_unref(msg); } } }
static void hd_bookmark_shortcut_activate_service (const gchar *url) { DBusMessage *msg = NULL; DBusError error; DBusConnection *conn; if (!url) { g_warning ("%s. Cannot open empty URL.", __FUNCTION__); return; } /* FIXME use libosso? */ dbus_error_init (&error); conn = dbus_bus_get (DBUS_BUS_SESSION, &error); if (dbus_error_is_set (&error)) { g_warning ("could not get session D-Bus: %s", error.message); dbus_error_free (&error); return; } msg = dbus_message_new_method_call (BROWSER_INTERFACE, BROWSER_PATH, BROWSER_INTERFACE, LOAD_URL_METHOD); if (msg == NULL) { g_warning ("failed to create message"); return; } dbus_message_set_auto_start (msg, TRUE); dbus_message_set_no_reply (msg, TRUE); if (!dbus_message_append_args (msg, DBUS_TYPE_STRING, &url, DBUS_TYPE_INVALID)) { g_warning ("failed to add url argument"); return; } if (!dbus_connection_send (conn, msg, NULL)) g_warning ("dbus_connection_send failed"); dbus_message_unref (msg); }
void GMNotifyDaemon::close() { if (msgid>0) { GM_DEBUG_PRINT("GMNotifyDaemon::close()\n"); DBusMessage * msg = method("CloseNotification"); if (msg) { dbus_message_append_args(msg,DBUS_TYPE_UINT32,&msgid,DBUS_TYPE_INVALID); dbus_message_set_no_reply(msg,true); bus->send(msg); // We don't want to wait for NotificationClosed signal. // and we want to prevent calling CloseNotification multiple times. msgid=0; } } }
static void agent_release(struct session_data *session) { struct agent_data *agent = session->agent; DBusMessage *message; message = dbus_message_new_method_call(agent->name, agent->path, AGENT_INTERFACE, "Release"); dbus_message_set_no_reply(message, TRUE); g_dbus_send_message(session->conn, message); agent_free(session); }
static gboolean dbus_reply_from_exception_and_sender(SeedContext ctx, const gchar *sender, dbus_uint32_t serial, DBusMessage **reply_p, SeedException *exception) { SeedValue name_val; gchar *s; const gchar *name = NULL; *reply_p = NULL; if (seed_value_is_undefined (ctx, *exception) || seed_value_is_null (ctx, *exception) || !seed_value_is_object (ctx, *exception)) return FALSE; name_val = seed_object_get_property(ctx, *exception, "dbusErrorName"); name = seed_value_to_string (ctx, name_val, NULL); s = seed_exception_to_string (ctx, *exception); g_warning("JS exception we will send as dbus reply to %s: %s", sender, s); *reply_p = dbus_message_new(DBUS_MESSAGE_TYPE_ERROR); dbus_message_set_destination(*reply_p, sender); dbus_message_set_reply_serial(*reply_p, serial); dbus_message_set_no_reply(*reply_p, TRUE); dbus_message_set_error_name(*reply_p, name ? name : DBUS_ERROR_FAILED); if (s != NULL) { DBusMessageIter iter; dbus_message_iter_init_append(*reply_p, &iter); if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &s)) { dbus_message_unref(*reply_p); g_free(s); return FALSE; } g_free(s); } return TRUE; }
NS_IMETHODIMP nsDBusHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowContext) { nsAutoCString spec; nsresult rv = aURI->GetAsciiSpec(spec); NS_ENSURE_SUCCESS(rv,rv); const char* uri = spec.get(); DBusError err; dbus_error_init(&err); DBusConnection *connection; connection = dbus_bus_get(DBUS_BUS_SESSION, &err); if (dbus_error_is_set(&err)) { dbus_error_free(&err); return NS_ERROR_FAILURE; } if (nullptr == connection) { return NS_ERROR_FAILURE; } dbus_connection_set_exit_on_disconnect(connection,false); DBusMessage* msg; msg = dbus_message_new_method_call(mService.get(), mObjpath.get(), mInterface.get(), mMethod.get()); if (!msg) { return NS_ERROR_FAILURE; } dbus_message_set_no_reply(msg, true); DBusMessageIter iter; dbus_message_iter_init_append(msg, &iter); dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &uri); if (dbus_connection_send(connection, msg, NULL)) { dbus_connection_flush(connection); dbus_message_unref(msg); } else { dbus_message_unref(msg); return NS_ERROR_FAILURE; } return NS_OK; }
static void agent_release(struct connman_agent *agent, const char *interface) { DBusMessage *message; DBG("release agent %s %s", agent->owner, agent->path); message = dbus_message_new_method_call(agent->owner, agent->path, interface, "Release"); if (!message) { connman_error("Couldn't allocate D-Bus message"); return; } dbus_message_set_no_reply(message, TRUE); g_dbus_send_message(connection, message); }
static void _dialog_ok_cb(void *data, E_Dialog *dialog) { E_Connman_Agent *agent = data; E_Connman_Agent_Input *input; Evas_Object *toolbook, *list; DBusMessageIter iter, dict; Eina_List *input_list, *l; DBusMessage *reply; toolbook = agent->dialog->content_object; /* fugly - no toolbook page get */ list = evas_object_data_get(toolbook, "mandatory"); if ((!list) || (!evas_object_visible_get(list))) { list = evas_object_data_get(toolbook, "alternate"); if ((!list) || (!evas_object_visible_get(list))) { ERR("Couldn't get user input."); e_object_del(E_OBJECT(dialog)); return; } } agent->canceled = EINA_FALSE; input_list = evas_object_data_get(list, "input_list"); reply = dbus_message_new_method_return(agent->msg); dbus_message_iter_init_append(reply, &iter); dbus_message_iter_open_container( &iter, DBUS_TYPE_ARRAY, DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); EINA_LIST_FOREACH(input_list, l, input) _dict_append_basic(&dict, input->key, input->value); dbus_message_iter_close_container(&iter, &dict); dbus_message_set_no_reply(reply, EINA_TRUE); e_dbus_message_send(agent->conn, reply, NULL, -1, NULL); e_object_del(E_OBJECT(dialog)); }
static bool xdbus_async_call_va(const char *srv, const char *obj, const char *ifc, const char *fun, DBusPendingCallNotifyFunction cb, void *aptr, DBusFreeFunction free_cb, int type, va_list va) { bool res = false; DBusMessage *req = 0; DBusPendingCall *pc = 0; if( !xdbus_con ) goto EXIT; if( !(req = dbus_message_new_method_call(srv, obj, ifc, fun)) ) goto EXIT; if( !dbus_message_append_args_valist(req, type, va) ) goto EXIT; if( !cb ) { dbus_message_set_no_reply(req, true); if( !dbus_connection_send(xdbus_con, req, 0) ) goto EXIT; } else { if( !dbus_connection_send_with_reply(xdbus_con, req, &pc, -1) ) goto EXIT; if( !dbus_pending_call_set_notify(pc, cb, aptr, free_cb) ) goto EXIT; } res = true; EXIT: if( !res ) log_error("%s.%s: failed to initiate query", ifc, fun); if( pc ) dbus_pending_call_unref(pc); if( req ) dbus_message_unref(req); return res; }
/* * This function is called when a new client (Phdc Agent) connects on the * same p2p service as the one we previously registered. We have to find the * right Phdc Manager (with the service name) to send it the file descriptor. */ static bool phdc_p2p_newclient(char *service_name, int agent_fd, gpointer data) { DBusMessage *msg; DBusMessageIter args; struct near_phdc_data *mgr; DBG(""); if ((!agent_fd) || (!service_name)) return false; DBG("service name: %s fd: %d", service_name, agent_fd); /* Look for existing service name */ mgr = g_hash_table_lookup(mgr_list, service_name); if (!mgr) return false; mgr->p2p_driver->user_data = mgr; /* Call the pdhc manager */ msg = dbus_message_new_method_call(mgr->sender, mgr->path, PHDC_MANAGER_IFACE, AGENT_NEWCONNECTION); if (!msg) { near_error("msg NULL"); return false; } /* Add args */ dbus_message_iter_init_append(msg, &args); if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_UNIX_FD, &agent_fd)) { near_error("out of memory"); return false; } dbus_message_set_no_reply(msg, TRUE); if (g_dbus_send_message(phdc_conn, msg) == FALSE) { near_error("Dbus send failed"); return false; } return true; }
static void supplicant_activate(DBusConnection *conn) { DBusMessage *message; _DBG_SUPPLICANT("conn %p", conn); message = dbus_message_new_method_call(SUPPLICANT_NAME, "/", DBUS_INTERFACE_INTROSPECTABLE, "Introspect"); if (message == NULL) return; dbus_message_set_no_reply(message, TRUE); dbus_connection_send(conn, message, NULL); dbus_message_unref(message); }
static int agent_send_cancel(struct connman_agent *agent) { DBusMessage *message; if (agent_sender == NULL || agent == NULL || agent->driver == NULL) return 0; message = dbus_message_new_method_call(agent_sender, agent_path, agent->driver->interface, "Cancel"); if (message != NULL) { dbus_message_set_no_reply(message, TRUE); g_dbus_send_message(connection, message); return 0; } connman_warn("Failed to send Cancel message to agent"); return -ESRCH; }