objective-cmacosnetwork-programmingcorewlan

CoreWLan - RSSI value difference between CWNetwork and CWInterface


I'm using the CoreWLan framework for Mac OS X to read RSSI values from an access point.

I can do it two different ways:

Using the Interface (that is connected to my network)

currentInterface = [CWInterface interface];
[currentInterface rssivalue];

Using the network:

currentInterface = [CWInterface interface];
networks = [[currentInterface scanForNetworksWithName:@"mySSID" error:nil] allObjects];
[networks[0] rssiValue];

However, it seems that these two methods (that should give the same value since the interface is connected to the network) give different results. The latter method seems to consistently give values of 3-5 dB stronger than the Interface method.

Any ideas as to why this discrepancy is happening? Which one is more "legitimate"?


Solution

  • The rssiValue property of the current interface (first case) gives you the aggregate rssi. While rssiValue of the scan results (second case) gives your the rssi value for the moment of scan. Thats why in general first one less than second one. But sometimes you can see the very low rssi values on scan results because of some interference.

    And there is another thing: there can be few access points with the same ssid, and in such case you can't be sure that networks[0] will be the result for currently connected one. You should check the bssid value first.