Emit 'scan_done' signal when scan finished
authorJiwan Kim <ji-wan.kim@samsung.com>
Thu, 2 Mar 2017 04:49:49 +0000 (13:49 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 17 Jul 2017 02:35:36 +0000 (11:35 +0900)
include/mesh-request.h
src/mesh-netlink.c
src/mesh-request.c

index 3557c78..2603ffb 100644 (file)
@@ -34,4 +34,7 @@ int mesh_request_specific_scan(const char* mesh_interface, const char* mesh_id,
                int mesh_channel);
 int mesh_request_cancel_scan(const char* mesh_interface);
 
+/* Notifications */
+void mesh_notify_scan_done();
+
 #endif /* __MESH_REQUEST_H__ */
index 5e4ca75..2704d59 100644 (file)
@@ -38,6 +38,7 @@
 #include "mesh-log.h"
 #include "mesh-util.h"
 #include "mesh-netlink.h"
+#include "mesh-request.h"
 
 #include "nl80211.h"
 
@@ -468,12 +469,18 @@ static int valid_handler(struct nl_msg *msg, void *arg)
                MESH_LOGD("   Got NL80211_CMD_SCAN_ABORTED.");
                state->callback_state = MESH_NL_CALLBACK_FINISHED;
                scan_in_progress = FALSE;
+
+               /* Notify scan done status */
+               mesh_notify_scan_done();
        } else if (gnlh->cmd == NL80211_CMD_NEW_SCAN_RESULTS) {
                guint id = 0;
                MESH_LOGD("   Got NL80211_CMD_NEW_SCAN_RESULTS.");
                state->callback_state = MESH_NL_CALLBACK_FINISHED;
                scan_in_progress = FALSE;
 
+               /* Notify scan done status */
+               mesh_notify_scan_done();
+
                id = g_idle_add(_dump_scan_results, g_strdup(state->scanning_interface));
                MESH_LOGD("request scan result dump [id:%d]", id);
        } else {
index c69b327..f230f61 100644 (file)
@@ -303,3 +303,10 @@ int mesh_request_create_bridge(const char* bridge_interface,
 
        return MESHD_ERROR_NONE;
 }
+
+void mesh_notify_scan_done()
+{
+       NetMesh *object = meshd_dbus_get_object();
+
+       net_mesh_emit_scan_done(object);
+}