Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Wifi Direct: Avoiding user acceptance when connecting to a known peer

Tags:

While connecting to a peer using WiFi Direct, user's permission is required. I know that connection can't be made without user never giving the permission and there's a feature request for this kind of functionality: https://code.google.com/p/android/issues/detail?id=30880

But I don't need this feature, asking for permission on the first connection is OK (also, more secure). Is there any method such that the permission is asked for the first time only? And when trying to connect to same peer later, the permission is not required.

like image 506
bishwas.bhatta Avatar asked Dec 18 '12 11:12

bishwas.bhatta


1 Answers

From the P2P specification we can find something called "persistent P2P group" which is intended to re-establish a group without user-intervention.

In a persitent P2P group the Group Owner stores the credentials of the group so that the group can be re-established in the future by the request of any group member without the need of user intervention.

Such a group can be formed by specifying persistent while connecting using command line (see the P2P of wpa_supplicant and search for p2p_connect command https://android.googlesource.com/platform/external/wpa_supplicant_8/+/ics-plus-aosp/wpa_supplicant/README-P2P). But I don't know if the option is available with the current devices.

Edit: See the answer to the question Can I change the group owner in a persistent group in Wi-Fi Direct?

Since I worked with Wi-Fi Direct on Ubuntu, I used wpa_cli (which comes along with wpa_supplicant) to create a persistent group as specified in the p2p_readme file.

like image 63
Chait Avatar answered Sep 30 '22 05:09

Chait