joshschmelzle / lswifi

a CLI-centric Wi-Fi scanning tool for Windows
https://pypi.org/project/lswifi/
BSD 3-Clause "New" or "Revised" License
49 stars 7 forks source link

Feature Request: Possibility to force connection based on BSSID #3

Closed lealog closed 2 years ago

lealog commented 3 years ago

Hi Josh,

Do you know if it's possible to force an STA to connect directly to a specific AP based on BSSID? This could be an interesting feature to have on lswifi package.

For linux we can use WPA_supplicant or nmcli (ex. nmcli d wifi connect aa:bb:cc:dd:ee:gg password "mypassword").

Thanks :)

joshschmelzle commented 3 years ago

Performing connection actions with lswifi is out of scope for what I am willing to develop and test. Contributions are welcome though!

lealog commented 3 years ago

Thanks Josh. I know one software that is able to do that - https://www.nirsoft.net/utils/wifi_information_view.html The command example is "WifiInfoView.exe /ConnectAP "MyNet" "00-25-9C-14-2C-39"".

If I found a way to implement by myself this "feature", I will send a PR :)

Thanks again.

joshschmelzle commented 3 years ago

Yes, it is possible to do what nirsoft is doing by using the wlanapi.h header. However, I did not implement the corresponding wrapper code. I think the first step would be adding corresponding wrapper code to wlanapi.py. Adding the new args to appsetup.py is straight forward. I think then the connection code (which calls the wrapper code) to client.py, and probably refactor __main__.py to call the client connection code instead of scanning for nearby networks.