summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2017-04-12 09:54:33 (GMT)
committerNiraj Kumar Goit <niraj.g@samsung.com>2017-04-12 09:54:33 (GMT)
commitf5c4f7207f8c80e681040ccbf6db3a01d6610dad (patch)
treebc7faf914bbb5f77690c7104e50d6365d4c857e2
parent1a8bd8384824f7b4b6e513c7eff6a6f4f02769cd (diff)
downloadconnman-f5c4f7207f8c80e681040ccbf6db3a01d6610dad.zip
connman-f5c4f7207f8c80e681040ccbf6db3a01d6610dad.tar.gz
connman-f5c4f7207f8c80e681040ccbf6db3a01d6610dad.tar.bz2
[connman] Send ScanChanged signal.refs/changes/66/124766/1
Send ScanChanged signal when device scanning status change. Change-Id: I9878cbb29d6c40363e6e629d6e6e7c855952ed0c Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
-rwxr-xr-xsrc/technology.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/technology.c b/src/technology.c
index a73a6d1..158a9de 100755
--- a/src/technology.c
+++ b/src/technology.c
@@ -1031,19 +1031,37 @@ static void reply_scan_pending(struct connman_technology *technology, int err)
}
}
-void __connman_technology_scan_started(struct connman_device *device)
-{
- DBG("device %p", device);
#if defined TIZEN_EXT
+dbus_bool_t __connman_technology_notify_scan_changed(const char *key, void *val)
+{
+ DBG("key %s", key);
DBusMessage *signal;
+ DBusMessageIter iter;
+ dbus_bool_t result = FALSE;
signal = dbus_message_new_signal(CONNMAN_MANAGER_PATH,
- CONNMAN_MANAGER_INTERFACE, "ScanStarted");
+ CONNMAN_MANAGER_INTERFACE, "ScanChanged");
if (!signal)
- return;
+ return result;
- dbus_connection_send(connection, signal, NULL);
+ dbus_message_iter_init_append(signal, &iter);
+ connman_dbus_property_append_basic(&iter, key, DBUS_TYPE_BOOLEAN, val);
+
+ result = dbus_connection_send(connection, signal, NULL);
dbus_message_unref(signal);
+
+ DBG("Successfuly sent signal");
+
+ return result;
+}
+#endif
+
+void __connman_technology_scan_started(struct connman_device *device)
+{
+ DBG("device %p", device);
+#if defined TIZEN_EXT
+ dbus_bool_t status = 1;
+ __connman_technology_notify_scan_changed("scan_started", &status);
#endif
}
@@ -1077,6 +1095,8 @@ void __connman_technology_scan_stopped(struct connman_device *device,
#if defined TIZEN_EXT
if (count == 0) {
DBusMessage *signal;
+ 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");