dbus: add 'scanning' property
When the supplicant is connected and performs a scan, it doesn't enter WPA_SCANNING state for various reasons. However, external programs still need to know that the supplicant is scanning since they may not wish to perform certain operations during a scan (as those operations will likely fail or yield incorrect results). Add a 'scanning' property and signal to the supplicant dbus interface to allow clients to synchronize better with the supplicant when it scans. Signed-off-by: Dan Williams <dcbw@redhat.com>
This commit is contained in:
parent
2976121955
commit
cb8564b1dd
8 changed files with 115 additions and 0 deletions
|
@ -1337,6 +1337,35 @@ DBusMessage * wpas_dbus_iface_get_state(DBusMessage *message,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_iface_get_scanning - Get interface scanning state
|
||||
* @message: Pointer to incoming dbus message
|
||||
* @wpa_s: wpa_supplicant structure for a network interface
|
||||
* Returns: A dbus message containing whether the interface is scanning
|
||||
*
|
||||
* Handler function for "scanning" method call.
|
||||
*/
|
||||
DBusMessage * wpas_dbus_iface_get_scanning(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
DBusMessage *reply = NULL;
|
||||
dbus_bool_t scanning = wpa_s->scanning ? TRUE : FALSE;
|
||||
|
||||
reply = dbus_message_new_method_return(message);
|
||||
if (reply != NULL) {
|
||||
dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &scanning,
|
||||
DBUS_TYPE_INVALID);
|
||||
} else {
|
||||
perror("wpas_dbus_iface_get_scanning[dbus]: out of "
|
||||
"memory.");
|
||||
wpa_printf(MSG_ERROR, "dbus control interface: not enough "
|
||||
"memory to return scanning state.");
|
||||
}
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_iface_set_blobs - Store named binary blobs (ie, for certificates)
|
||||
* @message: Pointer to incoming dbus message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue