• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dbus_connection_unref函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: free_ownership_restore_data

static void
free_ownership_restore_data (void *data)
{
  OwnershipRestoreData *d = data;

  if (d->service_link)
    _dbus_list_free_link (d->service_link);
  if (d->owner_link)
    _dbus_list_free_link (d->owner_link);
  if (d->hash_entry)
    _dbus_hash_table_free_preallocated_entry (d->service->registry->service_hash,
                                              d->hash_entry);

  dbus_connection_unref (d->owner->conn);
  bus_owner_unref (d->owner);
  bus_service_unref (d->service);
  
  dbus_free (d);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:19,代码来源:services.c


示例17: main

int main(int argc, char *argv[]) {
        int r, retval = EXIT_FAILURE;
        DBusConnection *bus = NULL;
        DBusError error;

        dbus_error_init(&error);

        setlocale(LC_ALL, "");
        log_parse_environment();
        log_open();

        r = parse_argv(argc, argv);
        if (r < 0)
                goto finish;
        else if (r == 0) {
                retval = EXIT_SUCCESS;
                goto finish;
        }

        if (arg_transport == TRANSPORT_NORMAL)
                bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error);
        else if (arg_transport == TRANSPORT_POLKIT)
                bus_connect_system_polkit(&bus, &error);
        else if (arg_transport == TRANSPORT_SSH)
                bus_connect_system_ssh(NULL, arg_host, &bus, &error);
        else
                assert_not_reached("Uh, invalid transport...");

        r = hostnamectl_main(bus, argc, argv, &error);
        retval = r < 0 ? EXIT_FAILURE : r;

finish:
        if (bus) {
                dbus_connection_flush(bus);
                dbus_connection_close(bus);
                dbus_connection_unref(bus);
        }

        dbus_error_free(&error);
        dbus_shutdown();

        return retval;
}
开发者ID:kwirk,项目名称:systemd,代码行数:43,代码来源:hostnamectl.c


示例18: dbus_bus_get

DBusConnection *connline_plugin_setup_event_loop(void)
{
	DBusConnection *dbus_cnx;

	dbus_cnx = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
	if (dbus_cnx == NULL)
		return NULL;

	if (setup_dbus_in_efl_mainloop(dbus_cnx) == FALSE) {
		dbus_connection_unref(dbus_cnx);
		return NULL;
	}

	if (triggers_table == NULL)
		triggers_table = eina_hash_pointer_new(
						remove_context_triggers);

	return dbus_cnx;
}
开发者ID:connectivity,项目名称:connline,代码行数:19,代码来源:efl.c


示例19: audio_init

static int audio_init(void)
{
	GKeyFile *config;
	gboolean enable_sco;

	connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
	if (connection == NULL)
		return -EIO;

	config = load_config_file(CONFIGDIR "/audio.conf");

	if (unix_init() < 0) {
		error("Unable to setup unix socket");
		goto failed;
	}

	if (audio_manager_init(connection, config, &enable_sco) < 0)
		goto failed;

	if (!enable_sco)
		return 0;

	sco_server = bt_io_listen(BT_IO_SCO, sco_server_cb, NULL, NULL,
					NULL, NULL,
					BT_IO_OPT_INVALID);
	if (!sco_server) {
		error("Unable to start SCO server socket");
		goto failed;
	}

	return 0;

failed:
	audio_manager_exit();
	unix_exit();

	if (connection) {
		dbus_connection_unref(connection);
		connection = NULL;
	}

	return -EIO;
}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:43,代码来源:main.c


示例20: map_init

int map_init(void)
{
	int err;

	DBG("");

	conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
	if (!conn)
		return -EIO;

	err = obc_driver_register(&map);
	if (err < 0) {
		dbus_connection_unref(conn);
		conn = NULL;
		return err;
	}

	return 0;
}
开发者ID:alvarofagner,项目名称:bluez,代码行数:19,代码来源:map.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dbus_error_free函数代码示例发布时间:2022-05-30
下一篇:
C++ dbus_connection_setup_with_g_main函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap