wpa_ctrl_recv()

Updated: April 19, 2023

Receive an event message

Synopsis:

#include <wpa_ctrl.h>
int wpa_ctrl_recv(struct wpa_ctrl *ctrl,
                  char *reply,
                  size_t *reply_len)

Arguments:

ctrl
Control connection data from wpa_ctrl_open()
reply
Buffer for storing the message data
reply_len
Pointer to memory for storing the message length (in bytes)

Library:

libwpactrl

Description:

This function receives an event message from the control connection. The message is written as a text string to the buffer in reply and reply_len is set to the actual message length. For details on how to parse the message contents, see the WPA events reference.

This function can be used only for event messages, meaning wpa_ctrl_attach() must have been used to register the caller as an event monitor.

Returns:

0 on success, -1 on failure