Code Monkey home page Code Monkey logo

simplewifi's People

Contributors

robinwassen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simplewifi's Issues

Is there any method to turn on/off the WiFi interface by using SimpleWiFi?

As the title, I can get the WiFi interface and list the available APs. Also to connect and delete the profile of the AP. I would like to add a switch button to turn on/off the WiFi interface. I know the Managed Native WiFi has this method, but it's wired to implement it just to turn on/off the interface. Can SimpleWiFi support to do this?

Not able to connect to a WLAN in case the SSID contains a '&' in its name

I was trying to connect to my WLAN, which got an '&' in its name.... But it simply never worked...
After a while (was already getting my head around the Managed Wifi API) I got the Idea to try it with a SSID Name not containing any special characters... et voila, this worked.

So in order to get the Simple Wifi API to work also with more exotic SSIDs simply add a HttpUtility.HtmlEncode() around the name in ProfileFactory.cs.

string name = HttpUtility.HtmlEncode(Encoding.ASCII.GetString(network.dot11Ssid.SSID, 0, (int)network.dot11Ssid.SSIDLength));

Hope this is usefull to anybody :)

get BSSID of Access point?

It seems that i cannot find a way to get the BSSID (Mac address) of the access points. I can get only the name and signal instead. Is there a way to get the access point's bssid?

Thanks.

This framework doens't manage IPs?

I need to change adapter's ip when a specific Wifi is connected, but I do not find support for this in this framework.

Does framework contain this functionality?

Help for use EAP-TLS

Hello. Thanks for your work. Can I use this code to connect to an AP using the pin code and Wps protocol?

ScanFail crashes in OnWlanNotification

Seems like some computers cause random crashes when it comes to the OnWlanNotification:

Event log:

Tillämpningsprogram: xx.exe
Framework-version: v4.0.30319
Beskrivning: Processen avslutades på grund av ett ohanterat undantag.
Undantagsinformation: System.ArgumentException
Stack:
vid System.Runtime.InteropServices.Marshal.SizeOfHelper(System.Type, Boolean)
vid System.Runtime.InteropServices.Marshal.SizeOf(System.Type)
vid SimpleWifi.Win32.WlanClient.OnWlanNotification(SimpleWifi.Win32.Interop.WlanNotificationData ByRef, IntPtr)

Felet uppstod i programmet med namn: xx.exe, version 1.0.0.0, tidsstämpel 0x51963996
, felet uppstod i modulen med namn: KERNELBASE.dll, version 6.2.9200.16451, tidsstämpel 0x50988950
Undantagskod: 0xe0434352
Felförskjutning: 0x00014b32
Process-ID: 0x518
Programmets starttid: 0x01ce66715458ffd5
Sökväg till program: C:\Program Files (x86)\xx\xx.exe
Sökväg till modul: C:\Windows\SYSTEM32\KERNELBASE.dll
Rapport-ID: 9d212623-d278-11e2-be9b-50465de78708
Fullständigt namn på felaktigt paket:
Program-ID relativt till felaktigt paket:

Wifi Proteceted Setup(WPS)

HI
FIRST OF ALL THX FOR YOUR GRAT WORK ON THIS PROJECT .
I WAS WONRING IF YOU ARE PLANING TO ADD WPS SUPPORT ?

Not getting interfaces

Hi.
I'm polling the wifi status every 5s. After a while i don't get any interfaces.
Example:
private IEnumerable<WifiAdapterType> GetActiveWlanInterfacesAndSensors(string filter = "") { var client = new SimpleWifi.Win32.WlanClient(); if (client.Interfaces == null) yield break; foreach (var iface in client.Interfaces.Where(x => !InvalidStates.Contains(x.InterfaceState))) {
I come always into the break.
If i try the same in a new process at the same time (breaking in the debug), it works.

在win10 中不支持中文wifi名

把wifi名的编码改为Default是可以连接,但是会是乱码

string SSID=Encoding.Default.GetString(network.dot11Ssid.SSID, 0, (int)network.dot11Ssid.SSIDLength);

GetTemplate: reader is null

In the getTemplate function, when I try to connect to a network:

An unhandled exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
Additional information: Value cannot be null.

For some reason, I added the core SimpleWifi files to the same solution, and I added a different solution, and to no avail. Is there any way to solve this?

Auto reconnect

I don't see a way to set the connection to automatically reconnect. Is this possible? I believe this is a part of the profile.

Filter only 2.4 ghz networks

Hi, is it possible to filter only 2.4 ghz networks while searching access points with GetAccessPoints() method ?
Thanks.

example in vb.net

hello
does anyone have the example in vb.net, please?
thanks and regards

Multiple wifi interfaces

If i try to use the library with a second wifi adapter, the process doesn't work although, the profile which i save on the second interface, works with windows (version 10).
I use SimpleWifi.Win32.WlanClient.Interfaces.
First i set the profile on the second interface. This works, and in ConnectSynchronously, i got error code 86: parameter incorrect error.

Ubuntu/Linux Support.

Will there be any Ubuntu/Linux support?

If no, Can I fix it somehow?

Greetings, Me.

SimpleWifi fails to detect connection to unsecured WifiHotspot

First of all, thanks for the library!

It works well for me, except for the case when I connect to the hotspot created on my Android device with security set to None. In this case SimpleWifi fails to find connected AccessPoint - IsConnected property on the corresponding AccessPoint instance incorrectly returns 'false'.

I wonder if AccessPoint.IsConnected property implementation should be changed so that it tries to match AccessPoint._interface.CurrentConnection.Name to SSID (accessible via AccessPoint.Name) whenever AccessPoint._network.profileName is an empty string?

In my case that would solve the issue. I can submit pull request if you think the fix makes sense.

Here is a screenshot from VS debugging session, to clarify the issue:
simplewifi_cannot_detect_ap_connection

Thanks!

Windows XP SP3 crash on init

One Windows XP SP3 machine crashed on init.

Stack trace:

System.ComponentModel.Win32Exception (0x80004005): Felaktig parameter
   vid SimpleWifi.Win32.Interop.WlanInterop.ThrowIfError(Int32 win32ErrorCode)
   vid SimpleWifi.Win32.WlanClient..ctor()
   vid SimpleWifi.Wifi..ctor()
   vid THEAPP.BLL.ViewModels.Dialogs.SaveOfflineFileDialogViewModel..ctor(ExamReport examReport)
   vid THEAPP.BLL.ViewModels.ExamScreenViewModel.InitShutdown()
   vid THEAPP.BLL.ViewModels.ExamScreenViewModel.<get_FinishExam>b__0(Object arg)
   vid THEAPP.BLL.Helpers.WPF.DelegateCommand.Execute(Object parameter)
   vid MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   vid System.Windows.Controls.Primitives.ButtonBase.OnClick()
   vid System.Windows.Controls.Button.OnClick()
   vid System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   vid System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   vid System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   vid System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   vid System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   vid System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   vid System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   vid System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   vid System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   vid System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   vid System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   vid System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   vid System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   vid System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   vid System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   vid System.Windows.Input.InputManager.ProcessStagingArea()
   vid System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   vid System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   vid System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   vid System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   vid System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   vid MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   vid MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   vid System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   vid MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   vid System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   vid MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   vid MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   vid System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   vid System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   vid System.Windows.Threading.Dispatcher.Run()
   vid System.Windows.Application.RunDispatcher(Object ignore)
   vid System.Windows.Application.RunInternal(Window window)
   vid System.Windows.Application.Run(Window window)
   vid THEAPP.App.Main()

Getting Selected Access Point from windows forms listbox

when trying to get the selected access point for the user to connect to I tried using
AccessPoint selectedAP = listBox1.SelectedItem;
and I get the error:
error CS0266: Cannot implicitly convert type 'object' to 'SimpleWifi.AccessPoint'. An explicit conversion exists (are you missing a cast?)
is there any way to fix this??

Windows 10 GetAccessPoints doesnt list wifi points after reboot

When I reboot my computer and run the program it only lists the single WiFi that my computer is connected to.

When I open the connection list in Windows (forcing the OS to do an SSID request) it then will list them all.. I imagine there is a call that you are missing that goes "Ok update my list of current visible SSIDs"

WPA don't accept special characters

When I'm trying to connect to a network with a key like this "1234567890&" I get an error 1206. If the key is 1234567890 on the same network it works just fine. How can I solve this problem?

Error When Radio turned off - Windows 10

If I have WIFI turned off in Windows, this is throwing an error when trying to getAplist.

Once we instantiate Wifi client class, prior to running functions, how best to check if radio is enabled or not before running further functions?

Connection Complete event reports incorrect status

Hi, thanks for this, it really works well :)

Just have noticed though, on Windows XP (I know, upgrade right? :P ) when the connection is successful, the OnConnectedComplete event still returns false. I haven't looked into it too much though, currently working around it by listing the connections and ensuring the selected one is connected which works fine. Just thought I'd bring this up.

Again, nice work with this 👍

nuget package

Creating a nuget package could provide more visibility to the project and allow users to keep their package up-to-date with new release.

Temporary profiles

Hi,
Iv been looking at your wifi library as an alternative to ManagedWifi simply because it offers the disconnect method. However, it doesnt support the use of temporary profiles (i.e. connecting to wifi without storing the profile in the system). This is a "must-have" feature for my App. How much work would it be to add this feature? I am not sure whether it is on a C++/Interop Level, or a managed interface level at the moment!

Thanks.

Feature request: Add Scan() function to Wifi class

During my test, some wifi SSID will disappear intermittently but then they appear again if I click on the WiFi icon in the Windows status tray. Sometimes I need to click the WiFi icon several times to see the specific SSID.

I think a re-scan begins each time I click the WiFi icon, seem to be this WlanScan function. In the interop code, it seems to be the Scan function.

I think it will be useful if we expose this 'Scan' function to 'Wifi' class, so we can call like this:

    var wifi = new Wifi();
    wifi.Scan();  //the feature request
    var apList = wifi.GetAccessPoints();

By the additional call of Scan(), we can try till we get the specific AP.

Is it possible?

Thanks.

Windows 10?

Does simplewifi support Windows 10? Either way, perhaps to avoid this question, it should be explicitly stated one way or another in the readme?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.