问题描述
目前,我正在试图连接两部手机哪知道通过WiFi直接对方的MAC地址,偶然发现了以下问题:MAC地址,我接受来自
WifiManager wifiMan =(WifiManager)本
.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInf = wifiMan.getConnectionInfo();
MAC_ADDRESS = wifiInf.getMacAddress();
略有不同,那么一个来自WifiP2pManager发现和请求同行当我收到。举例:A0:XX:XX:...变成A2:XX:XX ....有谁知道,为什么呢?我没有找到任何办法让无线网络直接MAC地址,并作为我认为的MAC地址应该是唯一的,它同样支持WiFi模块,可以同时处理(正常wifi和P2P /直),这是非常奇怪的..我该怎么办?对于两个设备(Galaxy Nexus的)我所得到的,它总是只有不同的MAC地址的前两个字符 - 我应该干脆放弃呢?是遇到问题(两个设备只不同的MAC地址的第一部分)的概率太高了?
感谢。
阅读有关 MAC地址在维基百科。
由于Wi-Fi直是另一个堆栈MAC之上,你也应该检查什么该位意味着它。我发现了一些邮件讨论脱落一些轻这一点。下面引用显然是从WFA规范。
所以,我认为这个问题的答案是,你不应该从 WifiManager
取MAC地址,并使用它与的Wi-Fi无线P2P
连接。
I'm currently trying to connect two phones which know each other's MAC address via WiFi Direct, and stumbled upon the following problem:The MAC address, I receive from
WifiManager wifiMan = (WifiManager) this
.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInf = wifiMan.getConnectionInfo();
MAC_ADDRESS = wifiInf.getMacAddress();
is slightly different then the one I receive from the WifiP2pManager when discovering and requesting peers. Example: a0:xx:xx:... turns into a2:xx:xx....Does anyone know, why? I did not find any way to get the "wifi direct mac address", and as I thought the mac address should be unique and it's the same wifi-module that handles both (normal wifi and p2p/direct) this is very weird..What should I do? For the two devices (Galaxy Nexus) I've got, it's always only the first two characters that differ in the mac addresses - should I simply discard them? Is the probability to encounter problems (two devices which only differ in the first part of mac address) too high?
Thanks.
Reading about the MAC address on wikipedia.
Since Wi-Fi Direct is just another stack on top of MAC, you should also check what that bit can mean for it. I've found some mail discussion shedding some light on this. Apparently quote below is from a WFA spec.
So I believe answer to this question is, you shouldn't take MAC address from WifiManager
and use it with Wi-Fi P2P
connections.
这篇关于无线网络直接和"正常"无线网络 - 不同的MAC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!