friedrith / node-wifi

📶 NodeJS tool to manage wifi (connections, scans)
MIT License
397 stars 161 forks source link

Wait until device is connected, delete profile if connection fails #26

Closed paumoreno closed 6 years ago

paumoreno commented 6 years ago

We are using this library in Windows, and we detected that connectToWifi's callback is called when Windows is told to connect to the network instead of waiting for it to actually connect.

I changed its behaviour, so it waits until netsh wlan connect is done and the profile XML is deleted.

Additionally, if the connection fails, the function also takes care of deleting the created connection profile.

paumoreno commented 6 years ago

Fixes #25

friedrith commented 6 years ago

You are totally right. I am just waiting to release the 2.0 version of node-wifi before accepting your pull request. It will be ok this weekend I think.

friedrith commented 6 years ago

There is a conflict after releasing version 2.0. Please can you rewrite your PL ?

paumoreno commented 6 years ago

Rewritten and tested!

paumoreno commented 6 years ago

Sorry, I added a new functionality in the same dev branch, which is related to issue #30

friedrith commented 6 years ago

Thx for all your contribution. I check it this weekend on my own and I accept it just after.

friedrith commented 6 years ago

I have read your PL and thank you a lot. It is quite clear. You added scan before connection in order to get the wifi network security protocol. So by this way you can connect to WEP.

Moreover, you used promises to better manager workflow and catch errors. I was not very happy to use promise because of Javascript compatibilities (Older versions of node don't manage promise I think) but whatever !

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.