在同一个Ad-Hoc模式下如何获取附近手机的RSSI和Mac地址?
我已将一些 Android 手机更改为 ad-hoc 模式,并让它们具有相同的 essid(通过在每部手机上使用命令:“iwconfig .. essid XXX”)。通过这种方式,它们合并为一个ad-hoc 网络,并且可以在其中成功发送 udp 数据包。
接下来,我想在同一个 ad-hoc 网络中获取附近手机的 RSSI 和 Mac 地址。我尝试启动 wpa_supplicant 进程并意图通过扫描获取 rssi(不是通过 android 系统,因此 android API 例如 getRssi()、getScanResult()无法使用),但我只得到一个essid“XXX”,它代表这个adhoc网络(BSSID)和一个假Mac地址。
然后我尝试修改命令“iwlist”在android上重新编译它,我得到了上面相同的结果..我不知道这种现象是由linux系统还是无线驱动程序决定的..
然后我尝试捕获信标数据包手机的,我得到了正确的mac和rssi,但是信标接收器处于监视模式而不是ad-hoc模式,因此无法将udp数据包发送到附近的手机..
那么我该怎么做才能获得每个手机的 RSSI 和 Mac 地址在同一个 Ad-Hoc 网络中吗?
多谢!!
I have changed the some android phones to ad-hoc mode and let them have the same essid (by using command on each phone:"iwconfig .. essid XXX").In this way they merged in one ad-hoc network and can successfully send udp packets among them.
Next, I want to get nearby phones's RSSI and Mac address in the same ad-hoc network.I try to start wpa_supplicant process and intent to get rssi by scaning(not through android system so android API such as getRssi(), getScanResult() could not be used), but I only get one essid "XXX" which stand for this adhoc network(BSSID) and a fake Mac address .
then I try to modify the command "iwlist" to recompile it on android, I got the same results above..I don't know whether this phenomenon is determined by linux system or wireless driver..
then I try to catch the beacon packets of the phone, I get the correct mac and rssi, but the beacon receiver is under moniter mode not in the ad-hoc mode,thus could not send udp packets to nearby phones..
so what can I do to get each phone's RSSI and Mac address in the same Ad-Hoc network?
thanks a lot!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定我完全理解你的问题,但我认为你对 WiFi 有一些误解。
首先,RSSI代表“接收信号强度指示”,意思是从接收器角度来看信号的强度。在您的情况下,一部电话了解另一部电话的 RSSI 的唯一方法是在更高层(即应用程序)传输有关 RSSI 的数据。
例如:
其次,我不完全了解 ad-hoc 网络如何处理 BSSID 等,但我相当清楚您肯定会遇到与上述 RSSI 类似的问题。即ad-hoc模式可能会选择使用哪个BSSID来建立WiFi网络。这不一定是任何设备的 MAC 地址(例如,它可以是假 MAC)。如果您想将一部手机自己的 MAC 传送到另一部手机,您必须将其放入应用程序层的消息中,然后将其发送到另一部手机上的接收应用程序。
例如:
简而言之,答案是:在应用程序层收集和共享信息,您无法从 wifi 堆栈中“嗅探/偷听”您想要的信息。
I am not sure I completely understand your question but I think you have a bit of a misunderstanding about WiFi.
First, RSSI stands for "Received Signal Strength Indication", which means the strength of the signal from the receiver's perspective. In your situation, the only way one phone can know the RSSI of another phone is if data about RSSI is communicated at a higher (i.e. application) layer.
For example:
Second, I'm not completely aware of how ad-hoc networks handle BSSIDs etc, but I'm fairly sure you will face a similar problem to the RSSI one above. I.e. The ad-hoc mode probably chooses which BSSID to use for the establishment of the WiFi network. This does not have to be the MAC address of any of the devices (e.g. it can be a fake MAC). If you want to communicate a phone's own MAC to another phone you will have to put it in a message at the application layer and send it to a receiving application on another phone.
For example:
So in short, the answer is: Collect and share the information at the application layer, you can't "sniffer/overhear" the information you are after from the wifi stack.