summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2019-11-29 08:11:46 (GMT)
committerJaehyun Kim <jeik01.kim@samsung.com>2019-12-04 07:28:58 (GMT)
commit0b07242ac61ec568ca4e722855c0c51f1f13fe72 (patch)
treec88d2bfd9c9c4070dfe421f407538102f7031288
parent56835be113cc083b6f815f56d34d543f35c1d88e (diff)
downloadconnman-accepted/tizen_unified.zip
connman-accepted/tizen_unified.tar.gz
connman-accepted/tizen_unified.tar.bz2
Change-Id: I2c247dd447a569642f19ff984fb9b318cceb676c Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
-rw-r--r--gsupplicant/gsupplicant.h1
-rw-r--r--gsupplicant/supplicant.c19
-rwxr-xr-xinclude/technology.h8
-rwxr-xr-xplugins/wifi.c23
-rw-r--r--src/technology.c43
5 files changed, 70 insertions, 24 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index c91ee9e..3e51348 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -491,6 +491,7 @@ struct _GSupplicantCallbacks {
#if defined TIZEN_EXT
void (*system_power_off) (void);
void (*assoc_failed) (void *user_data);
+ void (*scan_done) (GSupplicantInterface *interface);
#endif
void (*sta_authorized) (GSupplicantInterface *interface,
const char *addr);
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 159c710..0122b96 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -778,6 +778,17 @@ static void callback_assoc_failed(void *user_data)
callbacks_pointer->assoc_failed(user_data);
}
+
+static void callback_scan_done(GSupplicantInterface *interface)
+{
+ if (!callbacks_pointer)
+ return;
+
+ if (!callbacks_pointer->scan_done)
+ return;
+
+ callbacks_pointer->scan_done(interface);
+}
#endif
static void callback_network_changed(GSupplicantNetwork *network,
@@ -3146,7 +3157,8 @@ static void scan_bss_data(const char *key, DBusMessageIter *iter,
/*Fixed : stucking in scanning state when scan failed*/
#if defined TIZEN_EXT
- GSupplicantInterfaceCallback scan_callback;
+ GSupplicantInterfaceCallback scan_callback;
+ SUPPLICANT_DBG("");
#endif
if (iter)
@@ -3154,14 +3166,15 @@ static void scan_bss_data(const char *key, DBusMessageIter *iter,
interface);
#if defined TIZEN_EXT
- scan_callback = interface->scan_callback;
+ scan_callback = interface->scan_callback;
+ callback_scan_done(interface);
#endif
if (interface->scan_callback)
interface->scan_callback(0, interface, interface->scan_data);
#if defined TIZEN_EXT
- if (interface->scan_callback == scan_callback) {
+ if (interface->scan_callback == scan_callback) {
#endif
interface->scan_callback = NULL;
interface->scan_data = NULL;
diff --git a/include/technology.h b/include/technology.h
index 3bd6414..39de65d 100755
--- a/include/technology.h
+++ b/include/technology.h
@@ -41,6 +41,13 @@ typedef enum {
CONNMAN_MULTI_SCAN_SSID_FREQ,
} connman_multi_scan_type_e;
+typedef enum {
+ CONNMAN_SCAN_TYPE_FULL_CHANNEL = 0x00,
+ CONNMAN_SCAN_TYPE_SPECIFIC_AP,
+ CONNMAN_SCAN_TYPE_MULTI_AP,
+ CONNMAN_SCAN_TYPE_WPA_SUPPLICANT,
+} connman_scan_type_e;
+
typedef struct {
char str[128];
gboolean flag;
@@ -86,6 +93,7 @@ void connman_techonology_wifi_set_5ghz_supported(struct connman_technology *tech
bool is_5_0_Ghz_supported);
void connman_techonology_set_max_scan_ssids(struct connman_technology *technology,
int max_scan_ssids);
+void __connman_technology_notify_scan_done(int val);
#endif
#ifdef __cplusplus
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 1407441..97c325d 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -5344,6 +5344,26 @@ static void assoc_failed(void *user_data)
struct connman_network *network = user_data;
connman_network_set_associating(network, false);
}
+
+static void scan_done(GSupplicantInterface *interface)
+{
+ GList *list;
+ int scan_type = CONNMAN_SCAN_TYPE_WPA_SUPPLICANT;
+ struct wifi_data *wifi;
+ bool scanning;
+
+ for (list = iface_list; list; list = list->next) {
+ wifi = list->data;
+
+ if (interface == wifi->interface) {
+ scanning = connman_device_get_scanning(wifi->device,
+ CONNMAN_SERVICE_TYPE_WIFI);
+ if (!scanning)
+ __connman_technology_notify_scan_done(scan_type);
+ break;
+ }
+ }
+}
#endif
static void debug(const char *str)
@@ -5393,8 +5413,9 @@ static const GSupplicantCallbacks callbacks = {
.peer_request = peer_request,
#if defined TIZEN_EXT
.system_power_off = system_power_off,
- .network_merged = network_merged,
+ .network_merged = network_merged,
.assoc_failed = assoc_failed,
+ .scan_done = scan_done,
#endif
.debug = debug,
.disconnect_reasoncode = disconnect_reasoncode,
diff --git a/src/technology.c b/src/technology.c
index 782ce15..b00273e 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -48,12 +48,6 @@ static GHashTable *rfkill_list;
static bool global_offlinemode;
#if defined TIZEN_EXT
-typedef enum {
- CONNMAN_SCAN_TYPE_FULL_CHANNEL = 0x00,
- CONNMAN_SCAN_TYPE_SPECIFIC_AP,
- CONNMAN_SCAN_TYPE_MULTI_AP,
-} connman_scan_type_e;
-
static connman_scan_type_e g_scan_type = -1;
#endif
@@ -1123,6 +1117,27 @@ dbus_bool_t __connman_technology_notify_scan_changed(const char *key, void *val)
return result;
}
+
+void __connman_technology_notify_scan_done(int val)
+{
+ DBG("");
+ DBusMessage *signal;
+ DBusMessageIter iter;
+
+ signal = dbus_message_new_signal(CONNMAN_MANAGER_PATH,
+ CONNMAN_MANAGER_INTERFACE, "ScanDone");
+ if (!signal)
+ return;
+
+ dbus_message_iter_init_append(signal, &iter);
+ connman_dbus_property_append_basic(&iter, "Scantype",
+ DBUS_TYPE_INT32, &val);
+
+ dbus_connection_send(connection, signal, NULL);
+ dbus_message_unref(signal);
+
+ DBG("Successfuly sent signal");
+}
#endif
void __connman_technology_scan_started(struct connman_device *device)
@@ -1160,22 +1175,10 @@ void __connman_technology_scan_stopped(struct connman_device *device,
#if defined TIZEN_EXT
if (count == 0) {
- DBusMessage *signal;
- DBusMessageIter iter;
dbus_bool_t status = 0;
- __connman_technology_notify_scan_changed("scan_done", &status);
-
- signal = dbus_message_new_signal(CONNMAN_MANAGER_PATH,
- CONNMAN_MANAGER_INTERFACE, "ScanDone");
- if (!signal)
- return;
- dbus_message_iter_init_append(signal, &iter);
- connman_dbus_property_append_basic(&iter, "Scantype",
- DBUS_TYPE_INT32, &g_scan_type);
-
- dbus_connection_send(connection, signal, NULL);
- dbus_message_unref(signal);
+ __connman_technology_notify_scan_changed("scan_done", &status);
+ __connman_technology_notify_scan_done((int)g_scan_type);
reply_scan_pending(technology, 0);
DBG("Successfuly sent ScanDone signal");