Agostino Agostino - 1 month ago 30
C Question

Connect to wifi via c/c++ program

I'm searching on internet but I can't find anything about it.

Is there a way to do a scan for a wifi connection and to connect to one with a C/C++ program in Linux?

Answer

You are probably looking for Wireless Tools for Linux

The Wireless Extension (WE) is a generic API allowing a driver to expose to the user space configuration and statistics specific to common Wireless LANs. The beauty of it is that a single set of tool can support all the variations of Wireless LANs, regardless of their type (as long as the driver support Wireless Extension). Another advantage is these parameters may be changed on the fly without restarting the driver (or Linux).

The Wireless Tools (WT) is a set of tools allowing to manipulate the Wireless Extensions. They use a textual interface and are rather crude, but aim to support the full Wireless Extension. There are many other tools you can use with Wireless Extensions, however Wireless Tools is the reference implementation.

You can interact with NetworkManager is via DBus.