summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2017-03-20 14:39:02 (GMT)
committerNiraj Kumar Goit <niraj.g@samsung.com>2017-03-22 06:36:41 (GMT)
commit1a963f49de666b038d94fc217a356ebf4bab90c4 (patch)
treebef4c276e8dec7d1f0c5dc9cc5f8f58c55f7842d
parent199bca7e38232678c1c2ddbd3fc6a6b597bce6a7 (diff)
downloadconnman-1a963f49de666b038d94fc217a356ebf4bab90c4.zip
connman-1a963f49de666b038d94fc217a356ebf4bab90c4.tar.gz
connman-1a963f49de666b038d94fc217a356ebf4bab90c4.tar.bz2
[connman] Added DBus method to get scanning status.refs/changes/30/119930/2
Change-Id: Ib84cb1c218b6c468ffe413b63af2fe7a33c2a63e Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
-rwxr-xr-xsrc/technology.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/technology.c b/src/technology.c
index 969130c..a73a6d1 100755
--- a/src/technology.c
+++ b/src/technology.c
@@ -1148,6 +1148,42 @@ static DBusMessage *scan(DBusConnection *conn, DBusMessage *msg, void *data)
return NULL;
}
+#if defined TIZEN_EXT
+static DBusMessage *get_scan_state(DBusConnection *conn, DBusMessage *msg, void *data)
+{
+ DBusMessage *reply;
+ DBusMessageIter iter, dict;
+ GSList *list;
+ struct connman_technology *technology = data;
+ dbus_bool_t scanning;
+
+ DBG("technology %p", technology);
+
+ for (list = technology->device_list; list; list = list->next) {
+ struct connman_device *device = list->data;
+ scanning = connman_device_get_scanning(device);
+ if(scanning)
+ break;
+ }
+
+ DBG("scanning : %d", scanning);
+ reply = dbus_message_new_method_return(msg);
+ if (!reply)
+ return NULL;
+
+ dbus_message_iter_init_append(reply, &iter);
+
+ connman_dbus_dict_open(&iter, &dict);
+ connman_dbus_dict_append_basic(&dict, "Scanstate",
+ DBUS_TYPE_BOOLEAN,
+ &scanning);
+
+ connman_dbus_dict_close(&iter, &dict);
+
+ return reply;
+}
+#endif
+
static const GDBusMethodTable technology_methods[] = {
{ GDBUS_DEPRECATED_METHOD("GetProperties",
NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
@@ -1156,6 +1192,10 @@ static const GDBusMethodTable technology_methods[] = {
GDBUS_ARGS({ "name", "s" }, { "value", "v" }),
NULL, set_property) },
{ GDBUS_ASYNC_METHOD("Scan", NULL, NULL, scan) },
+#if defined TIZEN_EXT
+ { GDBUS_METHOD("GetScanState", NULL, GDBUS_ARGS({ "scan_state", "a{sv}" }),
+ get_scan_state) },
+#endif
{ },
};