[PATCH 2/2] WPS: Add DBUS Signal to notify WPS PBC Overlap event

Saurav Babu saurav.babu
Wed May 27 20:53:07 PDT 2015


<EP-BE58F15023F4476495C5B868B0A93F3A>
Signed-off-by: Saurav Babu <saurav.babu at samsung.com>
---
 wpa_supplicant/events.c         | 1 +
 wpa_supplicant/wps_supplicant.c | 9 +++++++++
 wpa_supplicant/wps_supplicant.h | 1 +
 3 files changed, 11 insertions(+)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index d086624..fcfd213 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1189,6 +1189,7 @@ int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
 #endif /* CONFIG_P2P */
 
 #ifdef CONFIG_WPS
+		wpas_wps_pbc_overlap(wpa_s);
 		wpas_wps_cancel(wpa_s);
 #endif /* CONFIG_WPS */
 		return -1;
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index f1d328d..4d1ae3c 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1236,6 +1236,15 @@ int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
 }
 
 
+void wpas_wps_pbc_overlap(struct wpa_supplicant *wpa_s)
+{
+	union wps_event_data data;
+	os_memset(&data, 0, sizeof(data));
+	data.fail.config_error = WPS_CFG_MULTIPLE_PBC_DETECTED;
+	data.fail.error_indication = WPS_EI_NO_ERROR;
+	wpa_supplicant_wps_event(wpa_s, WPS_EV_FAIL, &data);
+}
+
 /* Cancel the wps pbc/pin requests */
 int wpas_wps_cancel(struct wpa_supplicant *wpa_s)
 {
diff --git a/wpa_supplicant/wps_supplicant.h b/wpa_supplicant/wps_supplicant.h
index 683bd50..3c25ca8 100644
--- a/wpa_supplicant/wps_supplicant.h
+++ b/wpa_supplicant/wps_supplicant.h
@@ -33,6 +33,7 @@ int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
 		       int p2p_group);
 int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
 		       const char *pin, int p2p_group, u16 dev_pw_id);
+void wpas_wps_pbc_overlap(struct wpa_supplicant *wpa_s);
 int wpas_wps_cancel(struct wpa_supplicant *wpa_s);
 int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid,
 		       const char *pin, struct wps_new_ap_settings *settings);
-- 
1.9.1




More information about the Hostap mailing list