Code example for WifiP2pManager

Methods: connect

0
				Log.i(TAG, "Trying to connect to " + device.deviceName + "[" + device.deviceAddress +  "]");
				WifiP2pConfig config = new WifiP2pConfig();
				config.deviceAddress = device.deviceAddress;
				config.wps.setup = WpsInfo.PBC;
				if (!isConnecting) {
				wifiMgr.connect(channel, config, new TaggedActionListener("connect") {
					@Override 
					public void onFailure(int reason) {
						super.onFailure(reason);
						isConnecting = false;
					} 
					 
					public void onSuccess() { 
						super.onSuccess(); 
						isConnecting = false;
					} 
				}); 
				isConnecting = true;
				} 
			} 
		}