I'm trying to get the strength of the connected wifi signal using c++ on a Windows 7 machine.
I can get a value for the strength of the signal using the command WlanGetAvailableNetworkList
but the value returned is not granular enough for our requirements. Basically as you move away from the Wifi router the value jumps in increments of 20% (99% -> 80% -> 60% etc).
For the application we are developing we really need a more accurate value. I know it's possible as I have seen apps in windows displaying accurate dBm values for signal strength...
If anyone has any suggestions they would be greatly appreciated!
dwResult = WlanGetAvailableNetworkList(hClient,&pIfInfo->InterfaceGuid,0,NULL,&pBssList);
if (dwResult != ERROR_SUCCESS) {
wprintf(L"WlanGetAvailableNetworkList failed with error: %u\n", dwResult);
dwRetVal = 1;
} else {
for (j = 0; j < pBssList->dwNumberOfItems; j++) {
pBssEntry = (WLAN_AVAILABLE_NETWORK *) & pBssList->Network[j];
if ((pBssEntry->dwFlags & WLAN_AVAILABLE_NETWORK_CONNECTED ) != 0 ){
if (pBssEntry->wlanSignalQuality == 0)
iRSSI = -100;
else if (pBssEntry->wlanSignalQuality == 100)
iRSSI = -50;
else
iRSSI = -100 + (pBssEntry->wlanSignalQuality/2);
wprintf(L" Signal Quality[%u]:\t %u (RSSI: %i dBm)\n", j,
pBssEntry->wlanSignalQuality, iRSSI);
}
}