Ejemplo n.º 1
0
/**
 * Starts Health link with BlueZ.
 *
 * @param plugin_label sequential label of this plugin
 * @return success status
 */
static int init(unsigned int plugin_label)
{
	plugin_id = plugin_label;

	GError *error = NULL;

	if (conn)
		return NETWORK_ERROR_NONE;

	DEBUG("Starting BlueZ link...");

	// connect to the bus and check for errors
	conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);

	if (error != NULL) {
		ERROR(" network:dbus Connection Error (%s)", error->message);
		g_error_free(error);
		error = NULL;
	}

	if (NULL == conn) {
		ERROR(" network:dbus Connection Error, exiting");
		return NETWORK_ERROR;
	}

	if (!create_manager_proxy()) {
		ERROR(" network:dbus fail create_manager_proxy()");
		return NETWORK_ERROR;
	}

	connect_manager_signals();
	find_current_adapters();

	return NETWORK_ERROR_NONE;
}
Ejemplo n.º 2
0
static void
gs_monitor_init (GSMonitor *monitor)
{

        monitor->priv = GS_MONITOR_GET_PRIVATE (monitor);

#ifdef WITH_LATE_LOCKING
        monitor->priv->late_locking = WITH_LATE_LOCKING;
#endif
#ifdef WITH_LOCK_ON_SUSPEND
        monitor->priv->lock_on_suspend = WITH_LOCK_ON_SUSPEND;
#endif

        monitor->priv->listener = gs_listener_new ();
        monitor->priv->listener_x11 = gs_listener_x11_new ();
        connect_listener_signals (monitor);

        monitor->priv->manager = gs_manager_new ();
        connect_manager_signals (monitor);
}