sPFWFDMid/src/main/java/it/polimi/spf/wfd/WifiDirectMiddleware.java
@Subscribe
    public void onEternalConnectUpdate(EternalConnectEvent e) {
        if (e == null || e.getType() == null) {
            return;
        }

        WfdLog.d(TAG, "onEternalConnectUpdate received event: " + e.getType());

        //if you want, in the future, you can change the behaviour of either a
        //simple eternal connect reconnection (autonomous go) or a cycle of the eternal connect (clients)
        switch (e.getType()) {
            case EternalConnectEvent.NEW_EC_CYCLE:
            case EternalConnectEvent.SIMPLE_EC_RECONNECTION:
                disconnect();
                init();
                connect();
                break;
        }
    }
@Subscribe
    public void onEternalConnectUpdate(EternalConnectEvent e) {
        if (e == null || e.getType() == null) {
            return;
        }

        WfdLog.d(TAG, "onEternalConnectUpdate received event: " + e.getType());

        //if you want, in the future, you can change the behaviour of either a
        //simple eternal connect reconnection (autonomous go) or a cycle of the eternal connect (clients)
        switch (e.getType()) {
            case EternalConnectEvent.NEW_EC_CYCLE:
            case EternalConnectEvent.SIMPLE_EC_RECONNECTION:
                disconnect();
                init();
                connect();
                break;
        }
    }
subscribe to catch events posted by {@link EternalConnect}.