P2P: Add support for cross connection
[libeap.git] / wpa_supplicant / notify.c
index ac65b4f..c9a1b4b 100644 (file)
@@ -24,6 +24,7 @@
 #include "dbus/dbus_new.h"
 #include "driver_i.h"
 #include "scan.h"
+#include "p2p_supplicant.h"
 #include "notify.h"
 
 int wpas_notify_supplicant_initialized(struct wpa_global *global)
@@ -81,6 +82,13 @@ void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
 
        /* notify the new DBus API */
        wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_STATE);
+
+#ifdef CONFIG_P2P
+       if (new_state == WPA_COMPLETED)
+               wpas_p2p_notif_connected(wpa_s);
+       else if (new_state < WPA_ASSOCIATED)
+               wpas_p2p_notif_disconnected(wpa_s);
+#endif /* CONFIG_P2P */
 }