WiFi-Direct on JellyBean, WPA Provider Corrupted

so a couple of months ago I started developing some WiFi-Direct applications. A few days ago I upgraded both of my Galaxy Nexus to Jelly Bean (4.1.x) and tested my applications, but it seems like something was messed up there .. This is already a pain in the ass to get the main functionality configured on ICS, but now she doesn't work anymore.

All I get is something like this in my logcat:

/wpa_supplicant(  392): p2p0: P2P-PROV-DISC-PBC-REQ a2:0b:ba:xy:zz:xx p2p_dev_addr=a2:0b:ba:xy:zz:xx pri_dev_type=10-0050F204-x name='Android_e9f0' config_methods=0x188 dev_capab=0x27 group_capab=0x0
I/wpa_supplicant(  392): p2p0: P2P-DEVICE-FOUND a2:0b:ba:xy:zz:xx p2p_dev_addr=a2:0b:ba:xy:zz:xx pri_dev_type=10-0050F204-5 name='Android_e9f0' config_methods=0x188 dev_capab=0x27 group_capab=0x0
I/wpa_supplicant(  392): p2p0: P2P-GO-NEG-REQUEST a2:0b:ba:xx:zz:xy dev_passwd_id=4
I/wpa_supplicant(  392): p2p0: P2P-FIND-STOPPED 
I/wpa_supplicant(  392): p2p0: P2P-GO-NEG-FAILURE status=7
W/Netd    (  120): No subsystem found in netlink event
D/NetlinkEvent(  120): Unexpected netlink message. type=0x11
I/wpa_supplicant(  392): p2p0: P2P-DEVICE-LOST p2p_dev_addr=a2:0b:ba:xx:zz:xy
I/wpa_supplicant(  392): p2p0: P2P-DEVICE-FOUND a2:0b:ba:xx:zz:xy p2p_dev_addr=a2:0b:ba:xx:zz:xy pri_dev_type=10-0050F204-5 name='Android_e9f0' config_methods=0x188 dev_capab=0x27 group_capab=0x0

The “Invitation Dialog” appears on the second phone correctly, and “sometimes” (random) it even works, but only in every fifth attempt or something like that. Therefore, logcat tells me that I am not a professional with android start codes, that the negotiations just fail, the device is lost for a short time, and then it is discovered again, it seems that everything is messed up.

My invitations are sent as follows:

public void onPeersAvailable(WifiP2pDeviceList peers) {
    if (isInvitationSent)
        return;
    for (WifiP2pDevice dev : peers.getDeviceList()) {
        WifiP2pConfig c = new WifiP2pConfig();
        c.deviceAddress = dev.deviceAddress;
        c.wps.setup = WpsInfo.PBC;

        if (initiator
                && !isInvitationSent
                && WiFiSupport.compareMacAddressesInsensitive(MAC_ADDRESS,
                        dev.deviceAddress)) {
            isInvitationSent = true;
            sendInvitation(c);
        }
    }
}

private void sendInvitation(final WifiP2pConfig config) {
    log("Sending invitation to " + config.deviceAddress);
    mWifiManager.connect(mChannel, config, new ActionListener() {
        @Override
        public void onSuccess() {
            log("Invitation sent!");
        }

        @Override
        public void onFailure(int reason) {
            log("Invitation failed!");
            Toast.makeText(getApplicationContext(), "Could not connect to peer, reason:"+reason, Toast.LENGTH_LONG).show();
            if (!retryChannel) {
                log("Retrying to send invitation.");
                retryChannel = true;
                sendInvitation(config);
            }
        }
    });
}

I read a lot about wifi directly on Android, and it worked fine until I upgraded the phones to jelly bean .. does anyone know what could be wrong? If you need more code samples or any specific piece of code, just tell me, as I don't know what can be reliable for this.

Thank you for your help.

EDIT:

WifiP2pConfig.wps.setup "", №1 PIN-, №2 - , logcat

08-31 15:13:28.241: I/wpa_supplicant(384): p2p0: P2P-GO-NEG-SUCCESS 
08-31 15:13:28.241: I/wpa_supplicant(384): rfkill: Cannot open RFKILL control device
08-31 15:13:29.850: W/wpa_supplicant(384): p2p-p2p0-3: Could not connect to kernel driver
08-31 15:13:30.264: E/wpa_supplicant(384): Using interface p2p-p2p0-3 with hwaddr a2:0b:ba:x:y:z and ssid 'DIRECT-ps-Android_e9f0'
08-31 15:13:30.491: I/wpa_supplicant(384): p2p-p2p0-3: CTRL-EVENT-CONNECTED - Connection to a2:0b:ba:x:y:z completed (auth) [id=0 id_str=]
08-31 15:13:43.491: I/wpa_supplicant(384): p2p0: P2P-GROUP-FORMATION-FAILURE 
08-31 15:13:43.491: I/wpa_supplicant(384): p2p0: P2P-GROUP-REMOVED p2p-p2p0-3 GO
08-31 15:13:43.491: W/wpa_supplicant(384): p2p-p2p0-3: Could not connect to kernel driver
08-31 15:13:44.061: E/wpa_supplicant(384): Failed to remove interface (ifidx=15)
08-31 15:13:44.178: W/Netd(120): No subsystem found in netlink event
08-31 15:13:44.178: D/NetlinkEvent(120): Unexpected netlink message. type=0x11
08-31 15:13:44.248: W/Netd(120): No subsystem found in netlink event
08-31 15:13:44.248: D/NetlinkEvent(120): Unexpected netlink message. type=0x11
08-31 15:13:44.280: I/wpa_supplicant(384): p2p0: P2P-DEVICE-LOST p2p_dev_addr=a2:0b:ba:x:y:z
08-31 15:13:46.155: I/wpa_supplicant(384): p2p0: P2P-DEVICE-FOUND a2:0b:ba:x:y:z p2p_dev_addr=a2:0b:ba:x:y:z pri_dev_type=10-0050F204-5 name='Android_755f' config_methods=0x188 dev_capab=0x27 group_capab=0x0

:   08-31 15: 13: 43.491: W/wpa_supplicant (384): p2p-p2p0-3:

. wifi-direct-framework Android?

+5
2

, "" :

, , wifi, , wifi .., Android , WiFi Direct.

, Wi-Fi.

0

Android API Wi-Fi Direct Bean API 16. , API API ICS API- 14. Wi-Fi Direct,

WifiP2pDnsSdServiceInfo
WifiP2pDnsSdServiceRequest
WifiP2pServiceInfo
WifiP2pServiceRequest
WifiP2pUpnpServiceInfo
WifiP2pUpnpServiceRequest

WifiP2pManager. :

http://developer.android.com/reference/android/net/wifi/p2p/nsd/package-summary.html

IMO , - API 16. , , . Wi-Fi Direct. , . , , .

-1

All Articles