wifi-direct

Android Wi-Fi Direct: onPeersAvailable

大兔子大兔子 提交于 2019-12-09 11:31:13
问题 I'm developping a simple application based on WiFi Direct for Android that has to connect two devices. To do so I need to call to the función onPeersAvailable(myPeerListListener), but I don't know how. My app has this two elements: 1-Main Activity: package android.nacho.WifiDirect; import android.net.wifi.p2p.WifiP2pManager.Channel; import android.net.wifi.p2p.WifiP2pManager; import android.os.Bundle; import android.app.Activity; import android.content.BroadcastReceiver; import android

Clients/Peers communication with wifi-direct on Android platform

点点圈 提交于 2019-12-08 15:46:59
问题 I have three Android devices: A,B,and C. They are connected via wifi-direct (assuming B is the group owner). I just have two questions: 1. A want send a message to C, does the message have to pass the group owner B to reach C? 2. If the group owner B accidentally disconnected, will A still be able to send messages to C? Thanks! 回答1: In Wifi direct communication the P2P group owner (P2P GO) device implements AP-like functionality in the P2P Group., and devices acting as clients are known as

Wifi Direct Group Owner Intention

天涯浪子 提交于 2019-12-08 07:20:51
问题 Can someone explain me how android performs Group Owner Negotiation? In particular how does android perform GO request/reply exchange? Thanks! 回答1: You should set the Intention before connecting to the other WiFi p2p enabled devices. You do not need to do anything else regarding the GO negotiation. It means that you perform the discovery and then, you request to connect to one of the peers that is discovered. Then it would be the android API responsibility to perform the negotiation phase.

Android ARP clearing time

徘徊边缘 提交于 2019-12-08 02:23:23
问题 I am writing an app for WiFi direct and it uses the mac address I transfer via another method (that works) where the client will use the ARP table to find the IP of the host, since the groupownerintent doesn't work at all on android. However I keep finding my arp table only holds my WiFi access point (for internet access), and the additional p2p interface disappears in less than 5 minutes. What is the ARP timeout for Android, and is there a way to extend it? Perhaps in my app it is not an

How to get wifi direct devices name from WifiP2pDeviceList

。_饼干妹妹 提交于 2019-12-07 17:54:19
问题 I want to get the wi-fi direct name when I execute request peers, here is my code: if (WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION.equals(action)) { Log.d(tag, "success discover the peers "); if (mManager != null) { mManager.requestPeers(mChannel, new WifiP2pManager.PeerListListener() { @Override public void onPeersAvailable(WifiP2pDeviceList peers) { // TODO Auto-generated method stub if (peers != null) { if (device.deviceName.equals("ABC")) { Log.d(tag, "found device!!! "); Toast.makeText

Change WiFi-Direct IP range? Force IPv6 in Android WiFi-Direct?

一笑奈何 提交于 2019-12-07 10:21:00
问题 I have two Android KitKat phones, both are running WiFi-Direct groups as Group Owners, let's call them GO1 and GO2 I managed to connect GO1 as a legacy client to GO2 without breaking any of the (previously set) wifi-direct groups. The problem is that, as you might know, the GO IP address is hardcoded in Android source, and is set to 192.168.49.1 Therefore, both of my devices, GO1 and GO2 have the same IP address (**)... each on his local network. My app is both client and server at the same

Wifi direct connection disconnects automatically after a few seconds in Raspberry Pi

旧街凉风 提交于 2019-12-07 08:13:52
问题 I am using this configuration for wifi direct connection in Raspberry PI 2 B+ ctrl_interface=DIR=/var/run/wpa_supplicant driver_param=use_p2p_group_interface=1 update_config=1 device_name=Raspberry_pi device_type=1-0050F204-1 p2p_go_intent=1 p2p_go_ht40=1 country=IN and then started wpa supplicant using sudo wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant/p2p.conf -B and then add new group using sudo wpa_cli -iwlan0 p2p_group_add and then set an IP using ifconfig p2p-wlan0-0 192.168.1

Get Android network interface IP address

岁酱吖の 提交于 2019-12-07 04:03:03
问题 I am writing a wifi-direct application for Android. I am trying to make a socket connection to a device. Since the group owner intent function doesn't seem to work (it just assigns randomly it appears) I have to find a way to transfer the clients IP address to the host. The only address I know of is the host device which comes in the group info object that WifiP2pManager can get me. I know which device is the host and which one is the client so I can open a socket for a connection to arrive

wifi-direct end connection to peer on Android?

≯℡__Kan透↙ 提交于 2019-12-07 03:19:22
问题 Is there any way to end the connection to a peer over Wifi-Direct? I tried cancelConnect and removeGroup. Both of them returned Busy? thanks. 回答1: this is the method I am using to disconnect from peer. I noticed from logs that the android built in app also uses the same method to disconnect the peers. public static void disconnect() { if (mManager != null && mChannel != null) { mManager.requestGroupInfo(mChannel, new GroupInfoListener() { @Override public void onGroupInfoAvailable

Android ARP clearing time

一个人想着一个人 提交于 2019-12-06 14:18:14
I am writing an app for WiFi direct and it uses the mac address I transfer via another method (that works) where the client will use the ARP table to find the IP of the host, since the groupownerintent doesn't work at all on android. However I keep finding my arp table only holds my WiFi access point (for internet access), and the additional p2p interface disappears in less than 5 minutes. What is the ARP timeout for Android, and is there a way to extend it? Perhaps in my app it is not an issue but debugging is a real pain when the interface goes down, and then fails to connect via WiFi direct