32-如何克服Android中凭据的Wi-Fi Direct 32限制? [英] 32 - How to overcome the Wi-Fi Direct 32 limit on credentials in Android?

查看:93
本文介绍了32-如何克服Android中凭据的Wi-Fi Direct 32限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅-> 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; 

从本质上讲,这实际上限制了我可以在单个Wi-Fi Direct云"中连接的设备数量.

此问题来自 https://stackoverflow.com/a/26242221/1815624 /p>

此问题不是如何"连接多个设备的问题,例如多个设备的WiFi Direct

解决方案

CREDENTIAL_MAX_NUM是对WififP2pGroupList将存储的WifiP2pGroup对象数量的限制.对可以成为单个Wi-Fi Direct组成员的设备数量没有限制-理论上,该数量受该组IP地址范围的限制.这是对可以存储在设备中并由设备使用的持久性组的数量的限制.

WifiP2pGroupList由Wi-Fi P2P服务实例化,并由wpa_supplicant填充,因此通过反射更改CREDENTIAL_MAX_NUM的值不是解决方案,因为绑定可能会从请求者和P2P服务继承驻留在系统服务器进程中.

可以通过反射获取列表对象(为此,需要使用动态代理类来实现隐藏的方法WifiP2pManager.PersistentGroupInfoListener,然后通过IPC将其传递给系统服务),但是它的使用受到限制-对于所有组都将不包含凭据,因此无法缓存以备将来使用.列表的修改将被限制为WifiP2pManager公开的方法所提供的任何内容.

因此,总而言之,不可能修改CREDENTIAL_MAX_NUM,即使可以修改,但wpa_supplicant可能存在上限.

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

解决方案

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.

这篇关于32-如何克服Android中凭据的Wi-Fi Direct 32限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆