From a554f2c81c8efc4ef85168cce8b647ad8b1776fb Mon Sep 17 00:00:00 2001 From: marius maximus Date: Tue, 20 Jun 2017 20:50:55 +0200 Subject: [PATCH 1/5] add missing elements in enum WlanNotificationCodeAcm --- SimpleWifi/Win32/Interop/Enums.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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. From ea3050c3536b8c0f5c156369386a6d2f86826447 Mon Sep 17 00:00:00 2001 From: mariuszmaximus Date: Tue, 20 Jun 2017 20:59:32 +0200 Subject: [PATCH 2/5] Add Windows 10 in supported OS --- README.md | 1 + 1 file changed, 1 insertion(+) 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 ------------- From 3846d3c1e715ae23989134ea23eddc030074538f Mon Sep 17 00:00:00 2001 From: marius maximus Date: Tue, 20 Jun 2017 21:13:12 +0200 Subject: [PATCH 3/5] fix bug in event OnConnectionStatusChanged, on my windows 10 I have two events when disconnect (first is Connected, second Disconnected) --- SimpleWifi/Wifi.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SimpleWifi/Wifi.cs b/SimpleWifi/Wifi.cs index 89fccf9..e83b65e 100644 --- a/SimpleWifi/Wifi.cs +++ b/SimpleWifi/Wifi.cs @@ -94,11 +94,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) { From 8a16470d3b983d419e5937b400a67ffde4b46c09 Mon Sep 17 00:00:00 2001 From: mariuszmaximus Date: Wed, 13 Sep 2017 10:37:02 +0200 Subject: [PATCH 4/5] add InterfacesCount and Interfaces --- SimpleWifi/Wifi.cs | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/SimpleWifi/Wifi.cs b/SimpleWifi/Wifi.cs index e83b65e..4ae63be 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,28 @@ public Wifi() foreach (var inte in _client.Interfaces) inte.WlanNotification += inte_WlanNotification; } - - /// - /// Returns a list over all available access points - /// - public List GetAccessPoints() + + + /// + /// 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) From 6303388ac762e5d499659cd85b4d41cca6676d41 Mon Sep 17 00:00:00 2001 From: mariuszmaximus Date: Wed, 13 Sep 2017 10:52:16 +0200 Subject: [PATCH 5/5] Add InterfacesScan --- SimpleWifi/Wifi.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SimpleWifi/Wifi.cs b/SimpleWifi/Wifi.cs index 4ae63be..e51d38f 100644 --- a/SimpleWifi/Wifi.cs +++ b/SimpleWifi/Wifi.cs @@ -30,6 +30,16 @@ public Wifi() inte.WlanNotification += inte_WlanNotification; } + /// + /// Scann all interfaces + /// + public void InterfacesScan() + { + foreach (WlanInterface wlanIface in _client.Interfaces) + { + wlanIface.Scan(); + } + } /// /// Returns count Wi-Fi Interfaces