From d6b5205c4674173e05d9fc421dcf898314c62d8d Mon Sep 17 00:00:00 2001 From: Niraj Kumar Goit Date: Wed, 15 Jun 2016 16:13:46 +0530 Subject: [SPIN] request RemoveNetwork when disconnected to stop scanning in supplicant. Change-Id: I4248b2de4d00d4218dcfac078bcda3e95db83896 Signed-off-by: Niraj Kumar Goit --- gsupplicant/gsupplicant.h | 3 +++ gsupplicant/supplicant.c | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'gsupplicant') diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h index 776f6136..9d53d161 100755 --- a/gsupplicant/gsupplicant.h +++ b/gsupplicant/gsupplicant.h @@ -291,6 +291,9 @@ int g_supplicant_interface_disconnect(GSupplicantInterface *interface, GSupplicantInterfaceCallback callback, void *user_data); +#if defined TIZEN_EXT +int g_supplicant_interface_remove_network(GSupplicantInterface *interface); +#endif int g_supplicant_interface_set_apscan(GSupplicantInterface *interface, unsigned int ap_scan); diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index 2bb676eb..fb71df63 100755 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -2254,6 +2254,9 @@ static void interface_property(const char *key, DBusMessageIter *iter, } else if (g_strcmp0(key, "CurrentBSS") == 0) { interface_bss_added_without_keys(iter, interface); } else if (g_strcmp0(key, "CurrentNetwork") == 0) { +#if defined TIZEN_EXT + if (interface->state != G_SUPPLICANT_STATE_COMPLETED) +#endif interface_network_added(iter, interface); } else if (g_strcmp0(key, "BSSs") == 0) { supplicant_dbus_array_foreach(iter, @@ -5606,6 +5609,28 @@ int g_supplicant_set_widi_ies(GSupplicantP2PServiceParams *p2p_service_params, return -EINPROGRESS; } +#if defined TIZEN_EXT +int g_supplicant_interface_remove_network(GSupplicantInterface *interface) +{ + struct interface_data *data; + + SUPPLICANT_DBG(""); + + if (interface == NULL) + return -EINVAL; + + if (system_available == FALSE) + return -EFAULT; + + data = dbus_malloc0(sizeof(*data)); + if (data == NULL) + return -ENOMEM; + + data->interface = interface; + + return network_remove(data); +} +#endif static const char *g_supplicant_rule0 = "type=signal," "path=" DBUS_PATH_DBUS "," -- cgit v1.2.3