wloc 1.1.0
Simple Wi-Fi geolocation library and tool
wloc.fetchers.windows.wlan.WlanNativeAPI Class Reference
Inheritance diagram for wloc.fetchers.windows.wlan.WlanNativeAPI:
wloc.fetchers.native.NativeBackendCommon

Public Member Functions

None __init__ (self)
list get_networks (self)

Protected Member Functions

None _fetch_list (self)
list _get_interfaces (self)
list _get_networks (self, interface)
None _scan_networks (self, interface)

Static Protected Member Functions

int _wlan_enum_interfaces (handle, ifaces)
int _wlan_get_available_network_list (handle, iface_guid, network_list)
int _wlan_get_network_bss_list (handle, iface_guid, bss_list, ssid=None, security=False)
int _wlan_open_handle (client_version, negotiated_version, handle)
 _wlan_scan (handle, iface_guid)

Protected Attributes

int _client_version
 _handle
 _ifaces
 _negotiated_version
list _network_list = []
int _sleep_seconds = 5

Detailed Description

Special class for working with the Windows Native Wi-Fi API.

MSDN: https://docs.microsoft.com/en-us/windows/win32/api/wlanapi/

Constructor & Destructor Documentation

◆ __init__()

None wloc.fetchers.windows.wlan.WlanNativeAPI.__init__ ( self)
Main constructor of the NativeWiFi class.

Member Function Documentation

◆ _fetch_list()

None wloc.fetchers.windows.wlan.WlanNativeAPI._fetch_list ( self)
protected
Gets available network interfaces and fetches available wireless
networks into a special private field.

Reimplemented from wloc.fetchers.native.NativeBackendCommon.

◆ _get_interfaces()

list wloc.fetchers.windows.wlan.WlanNativeAPI._get_interfaces ( self)
protected
Gets the list of available Wi-Fi physical network interfaces.
:return: The list of available Wi-Fi physical network interfaces.

◆ _get_networks()

list wloc.fetchers.windows.wlan.WlanNativeAPI._get_networks ( self,
interface )
protected
Gets the list of available Wi-Fi networks with their BSSID and signal strength
from specified network interface.
:param interface: A physical network interface to use.
:return: The list of available Wi-Fi networks.

◆ _scan_networks()

None wloc.fetchers.windows.wlan.WlanNativeAPI._scan_networks ( self,
interface )
protected
Forces scanning of available Wi-Fi networks on the specified network
interface.
:param interface: A physical network interface to use.

◆ _wlan_enum_interfaces()

int wloc.fetchers.windows.wlan.WlanNativeAPI._wlan_enum_interfaces ( handle,
ifaces )
staticprotected
Python implementation of the WlanEnumInterfaces function from the Windows Native Wi-Fi API.

MSDN: https://docs.microsoft.com/en-us/windows/win32/api/wlanapi/nf-wlanapi-wlanenuminterfaces
:param handle: The client's session handle.
:param ifaces: A pointer to the WLAN_INTERFACE_INFO_LIST structure.
:return: Return ERROR_SUCCESS on success.

◆ _wlan_get_available_network_list()

int wloc.fetchers.windows.wlan.WlanNativeAPI._wlan_get_available_network_list ( handle,
iface_guid,
network_list )
staticprotected
Python implementation of the WlanGetAvailableNetworkList function from the Windows Native Wi-Fi API.

MSDN: https://docs.microsoft.com/en-us/windows/win32/api/wlanapi/nf-wlanapi-wlangetavailablenetworklist
:param handle: The client's session handle.
:param iface_guid: GUID of the wireless interface to be queried.
:param network_list: A pointer to the WLAN_AVAILABLE_NETWORK_LIST structure.
:return: Return ERROR_SUCCESS on success.

◆ _wlan_get_network_bss_list()

int wloc.fetchers.windows.wlan.WlanNativeAPI._wlan_get_network_bss_list ( handle,
iface_guid,
bss_list,
ssid = None,
security = False )
staticprotected
Python implementation of the WlanGetNetworkBssList function from the Windows Native Wi-Fi API.

MSDN: https://docs.microsoft.com/en-us/windows/win32/api/wlanapi/nf-wlanapi-wlangetnetworkbsslist
:param handle: The client's session handle.
:param iface_guid: GUID of the wireless interface to be queried.
:param bss_list: A pointer to the WLAN_BSS_LIST structure.
:param ssid: A pointer to a DOT11_SSID structure.
:param security: Indicates whether security is enabled on the network or not.
:return: Return ERROR_SUCCESS on success.

◆ _wlan_open_handle()

int wloc.fetchers.windows.wlan.WlanNativeAPI._wlan_open_handle ( client_version,
negotiated_version,
handle )
staticprotected
Python implementation of the WlanOpenHandle function from the Windows Native Wi-Fi API.

MSDN: https://docs.microsoft.com/en-us/windows/win32/api/wlanapi/nf-wlanapi-wlanopenhandle
:param client_version: The version of the highest WLAN API.
:param negotiated_version: The version of the WLAN API that will be used.
:param handle: Handle for the client.
:return: Return ERROR_SUCCESS on success.

◆ _wlan_scan()

wloc.fetchers.windows.wlan.WlanNativeAPI._wlan_scan ( handle,
iface_guid )
staticprotected
Python implementation of the WlanScan function from the Windows Native Wi-Fi API.

MSDN: https://docs.microsoft.com/en-us/windows/win32/api/wlanapi/nf-wlanapi-wlanscan
:param handle: The client's session handle.
:param iface_guid: A pointer to the WLAN_INTERFACE_INFO_LIST structure.
:return: Return ERROR_SUCCESS on success.

◆ get_networks()

list wloc.fetchers.native.NativeBackendCommon.get_networks ( self)
inherited
Gets the list of available Wi-Fi networks with their BSSID and
signal strength.
:return: The list of available Wi-Fi networks.