aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/dbus.doxygen5
-rw-r--r--wpa_supplicant/dbus/dbus_new.c38
-rw-r--r--wpa_supplicant/dbus/dbus_new.h6
-rw-r--r--wpa_supplicant/events.c1
-rw-r--r--wpa_supplicant/notify.c10
-rw-r--r--wpa_supplicant/notify.h1
6 files changed, 59 insertions, 2 deletions
diff --git a/doc/dbus.doxygen b/doc/dbus.doxygen
index d82cd63..6a6e91a 100644
--- a/doc/dbus.doxygen
+++ b/doc/dbus.doxygen
@@ -905,10 +905,11 @@ Interface for performing WPS (Wi-Fi Simple Config) operations.
<h4>Arguments</h4>
<dl>
<dt>s : event</dt>
- <dd>Event type. Possible values are: "success, "fail" and "m2d"</dd>
+ <dd>Event type. Possible values are: "success, "fail", "m2d", and
+ "pbc-overlap".</dd>
<dt>a{sv} : args</dt>
<dd>
- Event arguments. Empty for success event, one entry ( "msg" : i ) for fail event and following entries for m2d event:
+ Event arguments. Empty for success and pbc-voerlap events, one entry ( "msg" : i ) for fail event and following entries for m2d event:
<table>
<tr><th>config_methods</th><th>Value type</th>
<tr><td>manufacturer</td><td>q</td>
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index 4318bfb..fb674d4 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -525,6 +525,44 @@ void wpas_dbus_signal_network_enabled_changed(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_WPS
/**
+ * wpas_dbus_signal_wps_event_pbc_overlap - Signals PBC overlap WPS event
+ * @wpa_s: %wpa_supplicant network interface data
+ *
+ * Sends Event dbus signal with name "pbc-overlap" and empty dict as arguments
+ */
+void wpas_dbus_signal_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
+{
+
+ DBusMessage *msg;
+ DBusMessageIter iter, dict_iter;
+ struct wpas_dbus_priv *iface;
+ char *key = "pbc-overlap";
+
+ iface = wpa_s->global->dbus;
+
+ /* Do nothing if the control interface is not turned on */
+ if (iface == NULL || !wpa_s->dbus_new_path)
+ return;
+
+ msg = dbus_message_new_signal(wpa_s->dbus_new_path,
+ WPAS_DBUS_NEW_IFACE_WPS, "Event");
+ if (msg == NULL)
+ return;
+
+ dbus_message_iter_init_append(msg, &iter);
+
+ if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &key) ||
+ !wpa_dbus_dict_open_write(&iter, &dict_iter) ||
+ !wpa_dbus_dict_close_write(&iter, &dict_iter))
+ wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+ else
+ dbus_connection_send(iface->con, msg, NULL);
+
+ dbus_message_unref(msg);
+}
+
+
+/**
* wpas_dbus_signal_wps_event_success - Signals Success WPS event
* @wpa_s: %wpa_supplicant network interface data
*
diff --git a/wpa_supplicant/dbus/dbus_new.h b/wpa_supplicant/dbus/dbus_new.h
index 86bcdbf..7503348 100644
--- a/wpa_supplicant/dbus/dbus_new.h
+++ b/wpa_supplicant/dbus/dbus_new.h
@@ -152,6 +152,7 @@ void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
void wpas_dbus_signal_wps_event_fail(struct wpa_supplicant *wpa_s,
struct wps_event_fail *fail);
void wpas_dbus_signal_wps_event_success(struct wpa_supplicant *wpa_s);
+void wpas_dbus_signal_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s);
int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid);
int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid);
@@ -297,6 +298,11 @@ static inline void wpas_dbus_signal_wps_event_success(
{
}
+static inline void wpas_dbus_signal_wps_event_pbc_overlap(
+ struct wpa_supplicant *wpa_s)
+{
+}
+
static inline int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid)
{
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index d086624..a1dae30 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1179,6 +1179,7 @@ int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
if (wpas_wps_scan_pbc_overlap(wpa_s, selected, ssid)) {
wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_OVERLAP
"PBC session overlap");
+ wpas_notify_wps_event_pbc_overlap(wpa_s);
#ifdef CONFIG_P2P
if (wpa_s->p2p_group_interface == P2P_GROUP_INTERFACE_CLIENT ||
wpa_s->p2p_in_provisioning) {
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index 5cef646..c60d404 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -268,6 +268,16 @@ void wpas_notify_wps_event_success(struct wpa_supplicant *wpa_s)
#endif /* CONFIG_WPS */
}
+void wpas_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
+{
+ if (wpa_s->p2p_mgmt)
+ return;
+
+#ifdef CONFIG_WPS
+ wpas_dbus_signal_wps_event_pbc_overlap(wpa_s);
+#endif /* CONFIG_WPS */
+}
+
void wpas_notify_network_added(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid)
diff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h
index b02a442..1aeec47 100644
--- a/wpa_supplicant/notify.h
+++ b/wpa_supplicant/notify.h
@@ -45,6 +45,7 @@ void wpas_notify_wps_event_m2d(struct wpa_supplicant *wpa_s,
void wpas_notify_wps_event_fail(struct wpa_supplicant *wpa_s,
struct wps_event_fail *fail);
void wpas_notify_wps_event_success(struct wpa_supplicant *wpa_s);
+void wpas_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s);
void wpas_notify_network_added(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid);
void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,