Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok after continuing research online I managed to patch together a way that works for me. From what I've read - there are many different ways of obtaining the RSSI - but this method, while maybe a little cumbersome, worked well for our needs...</p> <p>I'm using the command WlanGetNetworkBssList, and then getting the RSSI value directly from the returned PWLAN_BSS_ENTRY.</p> <p>I found it is important to call WlanScan each time before querying WlanGetNetworkBssList, otherwise the returned value doesn't change with any sort of regularity.</p> <pre><code>HANDLE hClient; PWLAN_INTERFACE_INFO_LIST pIfList = NULL; PWLAN_INTERFACE_INFO pIfConnInfo = NULL; PWLAN_CONNECTION_ATTRIBUTES pConnectInfo = NULL; PWLAN_BSS_LIST pBssList=NULL; PWLAN_BSS_ENTRY pBssEntry=NULL; WLAN_OPCODE_VALUE_TYPE opCode = wlan_opcode_value_type_invalid; DWORD dwResult = 0; DWORD dwMaxClient = 2; DWORD dwCurVersion = 0; DWORD connectInfoSize = sizeof(WLAN_CONNECTION_ATTRIBUTES); int i; // Initialise the Handle dwResult = WlanOpenHandle(dwMaxClient, NULL, &amp;dwCurVersion, &amp;hClient); if (dwResult != ERROR_SUCCESS) { return 0; } // Get the Interface List dwResult = WlanEnumInterfaces(hClient, NULL, &amp;pIfList); if (dwResult != ERROR_SUCCESS) { return 0; } //Loop through the List to find the connected Interface PWLAN_INTERFACE_INFO pIfInfo = NULL; for (i = 0; i &lt; (int) pIfList-&gt;dwNumberOfItems; i++) { pIfInfo = (WLAN_INTERFACE_INFO *) &amp; pIfList-&gt;InterfaceInfo[i]; if (pIfInfo-&gt;isState == wlan_interface_state_connected) { pIfConnInfo = pIfInfo; break; } } if ( pIfConnInfo == NULL ) return 0; // Query the Interface dwResult = WlanQueryInterface(hClient,&amp;pIfConnInfo-&gt;InterfaceGuid,wlan_intf_opcode_current_connection,NULL,&amp;connectInfoSize,(PVOID *) &amp;pConnectInfo,&amp;opCode); if (dwResult != ERROR_SUCCESS) { return 0; } // Scan the connected SSID dwResult = WlanScan(hClient,&amp;pIfConnInfo-&gt;InterfaceGuid,&amp;pConnectInfo-&gt;wlanAssociationAttributes.dot11Ssid,NULL,NULL); if (dwResult != ERROR_SUCCESS) { return 0; } // Get the BSS Entry dwResult = WlanGetNetworkBssList(hClient,&amp;pIfConnInfo-&gt;InterfaceGuid,&amp;pConnectInfo-&gt;wlanAssociationAttributes.dot11Ssid,dot11_BSS_type_infrastructure,TRUE,NULL,&amp;pBssList); if (dwResult != ERROR_SUCCESS) { return 0; } // Get the RSSI value pBssEntry=&amp;pBssList-&gt;wlanBssEntries[0]; return pBssEntry-&gt;lRssi; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload