通过 c/c++ 程序连接到 wifi

Connect to wifi via c/c++ program

我正在互联网上搜索,但找不到任何相关信息。

有没有一种方法可以扫描 wifi 连接并使用 Linux 中的 C/C++ 程序连接到一个?

您可能正在寻找 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.

您可以通过 DBusNetworkManager 互动。