sPFWFDMid/src/main/java/it/polimi/spf/wfd/WifiDirectMiddleware.java
public void connect() {
        if (isConnected()) {
            Log.w(TAG, "Connect called but isConnected() == true");
            return;
        }

        this.startRegistration();
        this.discoverService();

        WfdLog.d(TAG, "-----> " + isAutonomous + " , " + goIntent);
        if (this.isAutonomous() && this.goIntent == 15) {
            this.createGroup();
        }

        this.connected = true;
    }
public void connect() {
        if (isConnected()) {
            Log.w(TAG, "Connect called but isConnected() == true");
            return;
        }

        this.startRegistration();
        this.discoverService();

        WfdLog.d(TAG, "-----> " + isAutonomous + " , " + goIntent);
        if (this.isAutonomous() && this.goIntent == 15) {
            this.createGroup();
        }

        this.connected = true;
    }
Method to connect. Called by {@link it.polimi.spf.wfdadapter.WFDMiddlewareAdapter#connect()}.