コード例 #1
0
ファイル: device.c プロジェクト: roland-wilhelm/connman
/**
 * connman_device_set_scanning:
 * @device: device structure
 * @scanning: scanning state
 *
 * Change scanning state of device
 */
int connman_device_set_scanning(struct connman_device *device,
						connman_bool_t scanning)
{
	DBG("device %p scanning %d", device, scanning);

	if (!device->driver || !device->driver->scan)
		return -EINVAL;

	if (device->scanning == scanning)
		return -EALREADY;

	device->scanning = scanning;

	if (scanning == TRUE) {
		__connman_technology_scan_started(device);

		g_hash_table_foreach(device->networks,
					mark_network_unavailable, NULL);

		return 0;
	}

	__connman_device_cleanup_networks(device);

	__connman_technology_scan_stopped(device);

	__connman_service_auto_connect();

	return 0;
}
コード例 #2
0
ファイル: session.c プロジェクト: jgke/connman-sandbox
static DBusMessage *connect_session(DBusConnection *conn,
                                    DBusMessage *msg, void *user_data)
{
    struct connman_session *session = user_data;

    DBG("session %p", session);

    if (ecall_session) {
        if (ecall_session->ecall && ecall_session != session)
            return __connman_error_failed(msg, EBUSY);

        session->ecall = true;
    }

    if (!session->active) {
        session->active = true;
        set_active_session(session, true);
    }

    session_activate(session);

    __connman_service_auto_connect(CONNMAN_SERVICE_CONNECT_REASON_SESSION);

    return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
コード例 #3
0
ファイル: device.c プロジェクト: drgogeta86/connman
/**
 * connman_device_set_scanning:
 * @device: device structure
 * @scanning: scanning state
 *
 * Change scanning state of device
 */
int connman_device_set_scanning(struct connman_device *device,
				enum connman_service_type type, bool scanning)
{
	DBG("device %p scanning %d", device, scanning);

	if (!device->driver || !device->driver->scan)
		return -EINVAL;

	if (device->scanning == scanning)
		return -EALREADY;

	device->scanning = scanning;

	if (scanning) {
		__connman_technology_scan_started(device);

		g_hash_table_foreach(device->networks,
					mark_network_unavailable, NULL);

		return 0;
	}

	__connman_device_cleanup_networks(device);

	__connman_technology_scan_stopped(device, type);

	__connman_service_auto_connect(CONNMAN_SERVICE_CONNECT_REASON_AUTO);

	return 0;
}
コード例 #4
0
ファイル: device.c プロジェクト: drgogeta86/connman
int connman_device_reconnect_service(struct connman_device *device)
{
	DBG("device %p", device);

	__connman_service_auto_connect(CONNMAN_SERVICE_CONNECT_REASON_AUTO);

	return 0;
}
コード例 #5
0
ファイル: device.c プロジェクト: rzr/connman
int connman_device_reconnect_service(struct connman_device *device)
{
	DBG("device %p", device);

	device->reconnect = true;

	__connman_service_auto_connect();

	return 0;
}