Skip to content
Advertisement

QT diconnect from wifi

I need to disconnect from current access point. I wrote this piece of code:

JavaScript

How can I disconnect from wifi? Or should I use C/C++ (some API) for that?

Advertisement

Answer

You can use QProcess and run system commands to connect and disconnect WiFi like below but this is Linux solution:

JavaScript

Replace wlp3s0 with your WiFi interface name. You can find your connected WiFi interface name with

JavaScript

and you can connect your WiFi again with:

JavaScript

For more info check this.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement