Updated: October 28, 2024 |
Open a control connection to the WPA control interface
#include <wpa_ctrl.h>
struct wpa_ctrl* wpa_ctrl_open(const char *ctrl_path)
This function opens a control connection to the WPA control interface. The control connection can be used for either commands or event messages, or both. But in the last case, when issuing any command, you must provide a callback function to wpa_ctrl_request(), to handle any unsolicited event messages received between the command request and the response. Often, it's easier to open two control connections by calling wpa_ctrl_open() twice and to then use one for commands and the other for event messages.
For a control connection used for event messages, you must then call wpa_ctrl_attach().
When you no longer need a control connection, you should close it by calling wpa_ctrl_close().
A pointer to abstract control connection data on success, NULL on failure