32 - How to overcome the Wi-Fi Direct 32 limit on credentials in Android?

浪子不回头ぞ 提交于 2019-12-02 14:03:28

问题


See-> https://android.googlesource.com/platform/frameworks/base/+/b267554/wifi/java/android/net/wifi/p2p/WifiP2pGroupList.java#34

private static final int CREDENTIAL_MAX_NUM             =   32; 

Which is essentially limiting the number of devices I can have connected in a single Wi-Fi Direct 'cloud' per se.

This Question spawns from the answer and comments at https://stackoverflow.com/a/26242221/1815624

This Question is not a question of "How to" connect multiple device such as found at WiFi Direct for multiple devices


回答1:


CREDENTIAL_MAX_NUM is a limit on the number of WifiP2pGroup objects that the the WififP2pGroupList will store. It is not a limit on the number of devices that can be a member a single Wi-Fi Direct group - this is theoretically bounded by the IP address range of the group. It is a bound on the number of persistent groups that can be stored in and utilised by the device.

WifiP2pGroupList is instantiated by the Wi-Fi P2P service and is populated by the wpa_supplicant, so changing the value of CREDENTIAL_MAX_NUM by reflection is not a solution, as the bound may be inherited from the supplicant and the P2P service resides in the system server process.

The list object can be acquired by reflection (to do this requires the use of a dynamic proxy class to implement the hidden method WifiP2pManager.PersistentGroupInfoListener and then passing this to the system service via IPC), but it's use is limited - for all groups it will not contain credentials, so caching for future use is not possible. Modification of the list will be restricted to whatever is provided by methods that are exposed by the WifiP2pManager.

So to summarise, modification of the CREDENTIAL_MAX_NUM is not possible and even if it was, an upper bound may exist in the wpa_supplicant.



来源:https://stackoverflow.com/questions/36211035/32-how-to-overcome-the-wi-fi-direct-32-limit-on-credentials-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!