I've been doing some work with the WLAN API and thought that some may be interested. It's not complete yet but there's enough to get anyone interested in 'playing' a reasonable start.
The attached is a small project which will display the attributes of all available Wireless Networks to the Immediate Window and populate a ComboBox with the Available Networks Profile Names. Click on 'Show Wireless Networks' to start.
Clicking on a Profile Name will disconnect from the current network and attempt to connect to that network (Note that I have only tested this part on an unsecured network - feedback on other types of networks would be appreciated). Clicking on the 'Disconnect' button will disconnect from the currently connected network.
The WLAN_NOTIFICATION_CALLBACK routine is used to show the various stages involved in Connection and Disconnection, which are also displayed to the Immediate Window.
A word of warning, when running from the IDE make sure you exit via the 'Exit' button. This ensures that the Notification process is terminated in a proper fashion. If you don't do that, then you'll find that the IDE crashes within 1 minute.
it lloks as if there is no support for bluetooth api for windows generally, but Windows CE. I heard that bluetooth device can be used by using mscomm, but don't know the specific command on how to use it
Programming is all about good logic. Spend more time here
I had a question but I have found a solution. Instead of deleting the post, I will post the code, somebody could find it useful:
In the declaration section of Doogle code:
Code:
Private Type WLAN_BSS_ENTRY
dot11Ssid As DOT11_SSID
phyId As Long
dot11Bssid(5) As Byte
dot11BssType As DOT11_BSS_TYPE
dot11BssPhyType As DOT11_PHY_TYPE
rssi As Long
LinkQuality As Long
inRegDomain As Boolean
BeaconPeriod As Long
timestamp As Currency
hostTimestamp As Currency
CapabilityInformation As Long
chCenterFrequency As Long
WlanRateSet As Long
ieOffset As Long
ieSize As Long
End Type
Private Declare Function WlanGetNetworkBssList _
Lib "wlanapi.dll" (ByVal hClientHandle As Long, _
pInterfaceGui As GUID, _
ByVal pDot11Ssid As Long, _
ByVal dot11BssType As Long, _
ByVal bSecurityEnabled As Long, _
ByVal pReserved As Long, _
ppWlanBssList As Long) As Long
And this is when enumerating networks:
Code:
Dim lBSS As Long
lngReturn = WlanGetNetworkBssList(lngHandle, udtList.InterfaceInfo.ifGuid, 0&, DOT11_BSS_TYPE.DOT11_BSS_TYPE_ANY, False, 0&, lBSS)
CopyMemory udtBSS, ByVal lBSS, LenB(udtBSS)
This is how can get additional wireless network information, like channel, transfer rates, rssi, and etc. More info @Microsoft
Thanks.
Last edited by npac4o; Dec 15th, 2019 at 09:13 PM.
With a little rearranging I got this program to work. Does anyone know why it does not show 5.0 GHz networks?
J.A. Coutts
It appears to be related to either the Adapter or the OS, as a Win 10 machine showed the 5.0 GHz networks before it crashed. When I checked the Network availability provided by MS on the Win 8.1 machine, the 5.0 GHz also did not show up.