diff --git a/README.md b/README.md index 79aaf09..2f28f1d 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Supported operating systems - Windows Vista - Windows 7 - Windows 8 +- Windows 10 Related links ------------- diff --git a/SimpleWifi/Wifi.cs b/SimpleWifi/Wifi.cs index 89fccf9..e51d38f 100644 --- a/SimpleWifi/Wifi.cs +++ b/SimpleWifi/Wifi.cs @@ -1,4 +1,4 @@ -using SimpleWifi.Win32; +using SimpleWifi.Win32; using System; using System.Collections.Generic; using System.Text; @@ -29,11 +29,38 @@ public Wifi() foreach (var inte in _client.Interfaces) inte.WlanNotification += inte_WlanNotification; } - - /// - /// Returns a list over all available access points - /// - public List GetAccessPoints() + + /// + /// Scann all interfaces + /// + public void InterfacesScan() + { + foreach (WlanInterface wlanIface in _client.Interfaces) + { + wlanIface.Scan(); + } + } + + /// + /// Returns count Wi-Fi Interfaces + /// + public int InterfacesCount() + { + return _client.Interfaces.Length; + } + + /// + /// Returns Interfaces + /// + public WlanInterface[] Interfaces() + { + return _client.Interfaces; + } + + /// + /// Returns a list over all available access points + /// + public List GetAccessPoints() { List accessPoints = new List(); if (_client.NoWifiAvailable) @@ -94,11 +121,11 @@ private set private void inte_WlanNotification(WlanNotificationData notifyData) { - if (notifyData.notificationSource == WlanNotificationSource.ACM && (NotifCodeACM)notifyData.NotificationCode == NotifCodeACM.Disconnected) - OnConnectionStatusChanged(WifiStatus.Disconnected); - else if (notifyData.notificationSource == WlanNotificationSource.MSM && (NotifCodeMSM)notifyData.NotificationCode == NotifCodeMSM.Connected) - OnConnectionStatusChanged(WifiStatus.Connected); - } + if (notifyData.notificationSource == WlanNotificationSource.ACM && (NotifCodeACM)notifyData.NotificationCode == NotifCodeACM.Disconnected) + OnConnectionStatusChanged(WifiStatus.Disconnected); + else if (notifyData.notificationSource == WlanNotificationSource.ACM && (NotifCodeACM)notifyData.NotificationCode == NotifCodeACM.ConnectionComplete) + OnConnectionStatusChanged(WifiStatus.Connected); + } private void OnConnectionStatusChanged(WifiStatus newStatus) { diff --git a/SimpleWifi/Win32/Interop/Enums.cs b/SimpleWifi/Win32/Interop/Enums.cs index 4e52f1b..b92ff1f 100644 --- a/SimpleWifi/Win32/Interop/Enums.cs +++ b/SimpleWifi/Win32/Interop/Enums.cs @@ -224,8 +224,13 @@ public enum WlanNotificationCodeAcm NetworkAvailable, Disconnecting, Disconnected, - AdhocNetworkStateChange - } + AdhocNetworkStateChange, + Profile_unblocked, + ScreenPowerChange, + ProfileBlocked, + ScanListRefresh, + AcmEnd + } /// /// Indicates the type of an MSM () notification.