当前位置: 首页>>代码示例>>C++>>正文


C++ dbus_connection_unref函数代码示例

本文整理汇总了C++中dbus_connection_unref函数的典型用法代码示例。如果您正苦于以下问题:C++ dbus_connection_unref函数的具体用法?C++ dbus_connection_unref怎么用?C++ dbus_connection_unref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dbus_connection_unref函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LOG

DBusConnection *setup_dbus_bus(DBusBusType type, const char *name,
							DBusError *error)
{
	DBusConnection *conn;
	LOG("setup_dbus_bus");
	conn = dbus_bus_get(type, error);
	if (error != NULL) {
		if (dbus_error_is_set(error) == TRUE)
			return NULL;
	}
	if (conn == NULL)
		return NULL;
	if (setup_bus(conn, name, error) == FALSE) {
		dbus_connection_unref(conn);
		return NULL;
	}
	return conn;
}
开发者ID:marttipiirainen,项目名称:provisioning-service,代码行数:18,代码来源:provisioning-receiver.c

示例2: reporter_exit

void reporter_exit(struct btd_adapter *adapter)
{
	struct reporter_adapter *radapter = find_reporter_adapter(adapter);
	if (!radapter)
		return;

	btd_unregister_device_driver(&reporter_device_driver);

	g_slist_foreach(radapter->devices, unregister_reporter_device,
								radapter);

	link_loss_unregister(adapter);
	imm_alert_unregister(adapter);
	dbus_connection_unref(radapter->conn);

	reporter_adapters = g_slist_remove(reporter_adapters, radapter);
	g_free(radapter);
}
开发者ID:BalintBanyasz,项目名称:bluez-rda,代码行数:18,代码来源:reporter.c

示例3: wpa_supplicant_dbus_ctrl_iface_deinit

/**
 * wpa_supplicant_dbus_ctrl_iface_deinit - Deinitialize dbus ctrl interface
 * @iface: Pointer to dbus private data from
 * wpa_supplicant_dbus_ctrl_iface_init()
 *
 * Deinitialize the dbus control interface that was initialized with
 * wpa_supplicant_dbus_ctrl_iface_init().
 */
void wpa_supplicant_dbus_ctrl_iface_deinit(struct ctrl_iface_dbus_priv *iface)
{
	if (iface == NULL)
		return;

	if (iface->con) {
		eloop_cancel_timeout(dispatch_initial_dbus_messages,
				     iface->con, NULL);
		dbus_connection_set_watch_functions(iface->con, NULL, NULL,
						    NULL, NULL, NULL);
		dbus_connection_set_timeout_functions(iface->con, NULL, NULL,
						      NULL, NULL, NULL);
		dbus_connection_unref(iface->con);
	}

	memset(iface, 0, sizeof(struct ctrl_iface_dbus_priv));
	free(iface);
}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:26,代码来源:ctrl_iface_dbus.c

示例4: dbus_connection_close

CUDisksProvider::~CUDisksProvider()
{
  DeviceMap::iterator itr;

  for (itr = m_AvailableDevices.begin(); itr != m_AvailableDevices.end(); ++itr)
    delete m_AvailableDevices[itr->first];

  m_AvailableDevices.clear();

  if (m_connection)
  {
    dbus_connection_close(m_connection);
    dbus_connection_unref(m_connection);
    m_connection = NULL;
  }

  dbus_error_free (&m_error);
}
开发者ID:DJMatty,项目名称:xbmc,代码行数:18,代码来源:UDisksProvider.cpp

示例5: connman_service_finalize

void connman_service_finalize(void)
{
	if (service_if == NULL)
		return;

	__connman_manager_register_service_signal(NULL);

	dbus_connection_unref(service_if->dbus_cnx);

	connman_service_deselect();

	g_slist_free(service_if->ordered_services);
	g_hash_table_destroy(service_if->services);

	g_free(service_if);

	service_if = NULL;
}
开发者ID:Jubei-Mitsuyoshi,项目名称:aaa-connman-ui,代码行数:18,代码来源:service.c

示例6: clear_user_data

static int clear_user_data(void)
{
  const char *dest  = ALARMD_SERVICE;
  const char *path  = ALARMD_PATH;
  const char *iface = ALARMD_INTERFACE;
  const char *name  = "clear_user_data";

  dbus_int32_t    nak = -1;
  DBusConnection *con = 0;
  DBusMessage    *msg = 0;
  DBusMessage    *rsp = 0;
  DBusError       err = DBUS_ERROR_INIT;

  if( (con = dbus_bus_get(DBUS_BUS_SYSTEM, &err)) == 0 )
  {
    goto cleanup;
  }

  if( (msg = dbus_message_new_method_call(dest, path, iface, name)) == 0 )
  {
    goto cleanup;
  }

  dbus_message_set_auto_start(msg, FALSE);

  if( !(rsp = dbus_connection_send_with_reply_and_block(con, msg, -1, &err)) )
  {
    goto cleanup;
  }

  dbus_message_get_args(rsp, &err,
                        DBUS_TYPE_INT32, &nak,
                        DBUS_TYPE_INVALID);

  cleanup:

  if( rsp != 0 ) dbus_message_unref(rsp);
  if( msg != 0 ) dbus_message_unref(msg);
  if( con != 0 ) dbus_connection_unref(con);

  dbus_error_free(&err);

  return (int)nak;
}
开发者ID:tidatida,项目名称:alarmd,代码行数:44,代码来源:alarmd.c

示例7: dbus_error_init

int OMXControl::dbus_connect(std::string& dbus_name)
{
  DBusError error;

  dbus_error_init(&error);
  if (!(bus = dbus_bus_get_private(DBUS_BUS_SESSION, &error)))
  {
    CLog::Log(LOGWARNING, "dbus_bus_get_private(): %s", error.message);
        goto fail;
  }

  dbus_connection_set_exit_on_disconnect(bus, FALSE);

  if (dbus_bus_request_name(
        bus,
        dbus_name.c_str(),
        DBUS_NAME_FLAG_DO_NOT_QUEUE,
        &error) != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
  {
        if (dbus_error_is_set(&error))
        {
            CLog::Log(LOGWARNING, "dbus_bus_request_name(): %s", error.message);
            goto fail;
        }

        CLog::Log(LOGWARNING, "Failed to acquire D-Bus name '%s'", dbus_name.c_str());
        goto fail;
    }

    return 0;

fail:
    if (dbus_error_is_set(&error))
        dbus_error_free(&error);

    if (bus)
    {
        dbus_connection_close(bus);
        dbus_connection_unref(bus);
        bus = NULL;
    }

    return -1;
}
开发者ID:entrusc,项目名称:omxplayer,代码行数:44,代码来源:OMXControl.cpp

示例8: auth_cb

static void auth_cb(DBusError *derr, void *user_data)
{
	struct service_adapter *serv_adapter = user_data;
	DBusMessage *reply;
	struct pending_auth *auth;
	bdaddr_t src;

	auth = next_pending(serv_adapter);
	if (auth == NULL) {
		info("Authorization cancelled: Client exited");
		return;
	}

	if (derr) {
		error("Access denied: %s", derr->message);

		reply = btd_error_not_authorized(auth->msg);
		dbus_message_unref(auth->msg);
		g_dbus_send_message(auth->conn, reply);
		goto done;
	}

	g_dbus_send_reply(auth->conn, auth->msg,
			DBUS_TYPE_INVALID);

done:
	dbus_connection_unref(auth->conn);

	serv_adapter->pending_list = g_slist_remove(serv_adapter->pending_list,
									auth);
	g_free(auth);

	auth = next_pending(serv_adapter);
	if (auth == NULL)
		return;

	if (serv_adapter->adapter)
		adapter_get_address(serv_adapter->adapter, &src);
	else
		bacpy(&src, BDADDR_ANY);

	btd_request_authorization(&src, &auth->dst,
					auth->uuid, auth_cb, serv_adapter);
}
开发者ID:520lly,项目名称:bluez,代码行数:44,代码来源:service.c

示例9: client_set_state

static void client_set_state(AvahiClient *client, AvahiClientState state) {
    assert(client);

    if (client->state == state)
        return;

    client->state = state;

    switch (client->state) {
        case AVAHI_CLIENT_FAILURE:
            if (client->bus) {
#ifdef HAVE_DBUS_CONNECTION_CLOSE
                dbus_connection_close(client->bus);
#else
                dbus_connection_disconnect(client->bus);
#endif
                dbus_connection_unref(client->bus);
                client->bus = NULL;
            }

            /* Fall through */

        case AVAHI_CLIENT_S_COLLISION:
        case AVAHI_CLIENT_S_REGISTERING:

            /* Clear cached strings */
            avahi_free(client->host_name);
            avahi_free(client->host_name_fqdn);
            avahi_free(client->domain_name);

            client->host_name =  NULL;
            client->host_name_fqdn = NULL;
            client->domain_name = NULL;
            break;

        case AVAHI_CLIENT_S_RUNNING:
        case AVAHI_CLIENT_CONNECTING:
            break;

    }

    if (client->callback)
        client->callback (client, state, client->userdata);
}
开发者ID:EBone,项目名称:Faust,代码行数:44,代码来源:client.c

示例10: bluetooth_exit

static void bluetooth_exit(void)
{
	/*
	 * We unset the disabling of the Bluetooth device when shutting down
	 * so that non-PAN BT connections are not affected.
	 */
	device_driver.disable = NULL;

	g_dbus_client_unref(client);

	connman_network_driver_unregister(&network_driver);
	g_hash_table_destroy(networks);

	connman_device_driver_unregister(&device_driver);
	g_hash_table_destroy(devices);

	connman_technology_driver_unregister(&tech_driver);
	dbus_connection_unref(connection);
}
开发者ID:igaw,项目名称:connman,代码行数:19,代码来源:bluetooth.c

示例11: _dbus_loop_unref

void
_dbus_loop_unref (DBusLoop *loop)
{
    _dbus_assert (loop != NULL);
    _dbus_assert (loop->refcount > 0);

    loop->refcount -= 1;
    if (loop->refcount == 0)
    {
        while (loop->need_dispatch)
        {
            DBusConnection *connection = _dbus_list_pop_first (&loop->need_dispatch);

            dbus_connection_unref (connection);
        }

        dbus_free (loop);
    }
}
开发者ID:scottt,项目名称:dbus-vmci,代码行数:19,代码来源:dbus-mainloop.c

示例12: wpas_dbus_deinit_common

static void wpas_dbus_deinit_common(struct wpas_dbus_priv *priv)
{
	if (priv->con) {
		eloop_cancel_timeout(dispatch_initial_dbus_messages,
				     priv->con, NULL);
		eloop_cancel_timeout(process_timeout, priv, ELOOP_ALL_CTX);

		dbus_connection_set_watch_functions(priv->con, NULL, NULL,
						    NULL, NULL, NULL);
		dbus_connection_set_timeout_functions(priv->con, NULL, NULL,
						      NULL, NULL, NULL);
		dbus_connection_remove_filter(priv->con, disconnect_filter,
					      priv);

		dbus_connection_unref(priv->con);
	}

	os_free(priv);
}
开发者ID:2asoft,项目名称:freebsd,代码行数:19,代码来源:dbus_common.c

示例13: __connman_tethering_cleanup

void __connman_tethering_cleanup(void)
{
	DBG("enabled %d", tethering_enabled);

	__sync_synchronize();
	if (tethering_enabled > 0) {
		if (tethering_dhcp_server)
			dhcp_server_stop(tethering_dhcp_server);
		__connman_bridge_disable(BRIDGE_NAME);
		__connman_bridge_remove(BRIDGE_NAME);
		__connman_nat_disable(BRIDGE_NAME);
	}

	if (connection == NULL)
		return;

	g_hash_table_destroy(pn_hash);
	dbus_connection_unref(connection);
}
开发者ID:Jubei-Mitsuyoshi,项目名称:aaa-connman,代码行数:19,代码来源:tethering.c

示例14: ac_manage_dbus_filter_function

static DBusHandlerResult
ac_manage_dbus_filter_function (DBusConnection * connection, DBusMessage * message, void *user_data) {

	if(dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected") 
		&& strcmp(dbus_message_get_path(message), DBUS_PATH_LOCAL) == 0) {
		dbus_connection_unref(ac_manage_dbus_connection);
		ac_manage_dbus_connection = NULL;
	}
#if 0	
	else if((dbus_message_is_signal (message, SNMP_MANAGE_DBUS_INTERFACE, NPD_DBUS_ROUTE_METHOD_NOTIFY_SNMP_MIB_BY_VRRP))) {
		snmp_mib_dbus_had_master_advertise(message);
	}
#endif	
	else {
		return TRUE;
	}
	
	return DBUS_HANDLER_RESULT_HANDLED;
}
开发者ID:inibir,项目名称:daemongroup,代码行数:19,代码来源:ac_manage_dbus.c

示例15: cka_dbus_quit

/** Remove signal and method call message handlers
 */
static void cka_dbus_quit(void)
{
  if( !cka_dbus_systembus )
  {
    goto EXIT;
  }

  /* Remove signal handling filter */
  dbus_connection_remove_filter(cka_dbus_systembus,
                                cka_dbus_filter_message_cb, 0);

  /* Remove dbus method call handlers that we have registered */
  mce_dbus_handler_unregister_array(cka_dbus_handlers);

  dbus_connection_unref(cka_dbus_systembus), cka_dbus_systembus = 0;

EXIT:
  return;
}
开发者ID:spiiroin,项目名称:mce,代码行数:21,代码来源:cpu-keepalive.c


注:本文中的dbus_connection_unref函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。