Code example for WifiP2pConfig

0
	 * be invoked when the connection is established. 
	 *  
	 * @param peer the peer device to connect to. 
	 */ 
	public void connectToPeer(WifiP2pDevice peer) {
		WifiP2pConfig config = new WifiP2pConfig();
		config.deviceAddress = peer.deviceAddress;
		config.wps.setup = WpsInfo.PBC;
		 
		mManager.connect(mChannel, config, new ActionListener() {
			@Override 
			public void onSuccess() { 
				// Let WifiBroadcastReceiver notify us. Ignore it here. 
			} 
			 
			@Override 
			public void onFailure(int reason) {
				// TODO: notify someone. 
			} 
		}); 
Contextual code suggestions in your IDE  Get Codota for Java