问题
I've been looking over the Android Wifi direct APIs and I can't seem to find out if it is possible to change the frequency/channel Wifi direct uses to communicate? (channels 1, 6, or 11 for example)
Does anybody know if this is possible with the developer API? If not, does anybody know if there is some third party library that could possibly require root access to accomplish this?
Thanks in advance for any help you can provide.
回答1:
In order to change the channel of the Wifi Direct of your device you need to do the following: 1- Root your phone 2- Download any File manager App: Such as ES File Explorer 3- On ES File Explorer, go to Tools, then turn ON the Root Explorer and click on it then mount RW 4- Using ES File Explorer, go to Device -> Data -> Misc -> Wifi -> p2p_supplicant.conf and change the p2p_oper_channel to whatever channel you want. 5- Turn OFF the Wifi of your phone then turn it ON in order for the change to take place.
You should note that in order for the Wifi direct channel to be the one you did set, the phone needs not to be connected to any Access point when the wifi direct connection starts. Also, usually when phone A connects to phone B via wifi direct, the connection is operating on phone B's channel.
In order to implement an App to do this dynamically, you can let the App execute a process that will modify the file by issuing a command.
Hope this helps
来源:https://stackoverflow.com/questions/26374358/choose-wifi-direct-channel-frequency-band-in-android-sdk