I'm not sure I fully understand your question, but I think you have a bit of an obscure attitude towards Wi-Fi.
Firstly, RSSI stands for โSignal Strength of a Receive Signal,โ which means signal strength from the perspective of the receiver. In your situation, the only way to know one RSSI of another phone is if the RSSI data is transmitted at a higher (i.e. application) level.
For instance:
- Phone A sends an XYZ radio message to Phone B.
- Phone B can hear the XYZ message from Phone A at -75dBm.
- Phone B can then send a message to Phone A to inform Phone A that it is listening on Phone A at -75dBm.
- (Phone A can now use the same as Phone B, using the RSSI messages it receives from phone B)
Secondly, I do not quite understand how ad-hoc networks handle BSSIDs, etc., but I am sure that you will encounter a similar problem with RSSI described above. That is, ad-hoc mode probably chooses which BSSID to use to establish the WiFi network. This should not be the MAC address of any of the devices (for example, it could be a fake MAC address). If you want to transfer your own MAC address to another phone, you will have to put it in a message at the application level and send it to the receiving application on another phone.
For instance:
- Phone A requests its own OS / Network interfaces and finds its own MAC address (NB: it can find more than one!)
- Phone A places this in the application message (i.e. your own UDP packet) and sends it to Phone B.
- Phone B receives the message, unpacks the message, and finds out what MAC phone A told him.
So, in short, the answer is: collect and exchange information at the application level, you can not "sniffer / listen" to the information received after the Wi-Fi stack.
source share