#define NETCONFIG_DEL_FOUND_AP_NOTI "del_found_ap_noti"
#define NETCONFIG_ADD_PORTAL_NOTI "add_portal_noti"
#define NETCONFIG_DEL_PORTAL_NOTI "del_portal_noti"
+#define NETCONFIG_ADD_IP_CONFLICT_NOTI "add_ip_conflict_noti"
+#define NETCONFIG_DEL_IP_CONFLICT_NOTI "del_ip_conflict_noti"
struct wifi_authentication_data {
int auth_result;
}
-gboolean headed_send_notification_to_net_popup(const char * noti, const char * ssid)
+gboolean headed_send_notification_to_net_popup(const char * noti, const char * message)
{
int ret = 0;
bundle *b;
static gboolean is_found_noti_exists = FALSE;
static gboolean is_portal_noti_exists = FALSE;
+ static gboolean is_conflict_noti_exists = FALSE;
if (noti == NULL) {
ERR("Invalid notification");
return TRUE;
is_portal_noti_exists = FALSE;
+ } else if (g_strcmp0(noti, NETCONFIG_DEL_IP_CONFLICT_NOTI) == 0) {
+ if (is_conflict_noti_exists == FALSE)
+ return TRUE;
+
+ is_conflict_noti_exists = FALSE;
+ } else if (g_strcmp0(noti, NETCONFIG_ADD_IP_CONFLICT_NOTI) == 0) {
+ if (is_conflict_noti_exists == TRUE)
+ return TRUE;
+
+ is_conflict_noti_exists = TRUE;
}
b = bundle_create();
bundle_add(b, "_SYSPOPUP_TYPE_", noti);
- if (ssid != NULL) {
- DBG("ssid (%s)", ssid);
- bundle_add(b, "_AP_NAME_", ssid);
+ if (message != NULL) {
+ DBG("message (%s)", message);
+ if (g_strcmp0(noti, NETCONFIG_ADD_IP_CONFLICT_NOTI) == 0)
+ bundle_add(b, "_MAC_ADDRESS_", message);
+ else
+ bundle_add(b, "_AP_NAME_", message);
}
ret = syspopup_launch("net-popup", b);
#include "network-state.h"
#include "log.h"
#include "neterror.h"
+#include "util.h"
#define ARP_PACKET_SIZE 60
#define MAX_SIZE_ERROR_BUFFER 256
wifi_emit_ip_conflict_event((Wifi *)get_wifi_object(), g_variant_builder_end(builder));
g_variant_builder_unref(builder);
+ /* send notification using net-popup */
+ if (!strcmp(state, "conflict"))
+ netconfig_send_notification_to_net_popup(NETCONFIG_ADD_IP_CONFLICT_NOTI, mac);
+ else
+ netconfig_send_notification_to_net_popup(NETCONFIG_DEL_IP_CONFLICT_NOTI, mac);
+
return;
}
/* Inform net-popup to remove the wifi found notification */
netconfig_send_notification_to_net_popup(NETCONFIG_DEL_FOUND_AP_NOTI, NULL);
netconfig_send_notification_to_net_popup(NETCONFIG_DEL_PORTAL_NOTI, NULL);
+ netconfig_send_notification_to_net_popup(NETCONFIG_DEL_IP_CONFLICT_NOTI, NULL);
_deregister_network_notification();
}