summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2016-06-15 14:43:09 (GMT)
committerNiraj Kumar Goit <niraj.g@samsung.com>2016-06-17 10:33:30 (GMT)
commit6e3436df89f8293c60ef750a6e442f1203f56d40 (patch)
treee9e19f6567b81ce68400ca0221ee69295db903f7 /gsupplicant
parent5858fc542fa6bd5766e6caee92e1a437656ce8de (diff)
downloadconnman-6e3436df89f8293c60ef750a6e442f1203f56d40.zip
connman-6e3436df89f8293c60ef750a6e442f1203f56d40.tar.gz
connman-6e3436df89f8293c60ef750a6e442f1203f56d40.tar.bz2
[SPIN] Added the connman disconnect reason property.refs/changes/06/74706/2
Change-Id: I11fd7baa7d00fa3f3a12bdafda7ff7aa6943d020 Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
Diffstat (limited to 'gsupplicant')
-rwxr-xr-xgsupplicant/gsupplicant.h1
-rwxr-xr-xgsupplicant/supplicant.c31
2 files changed, 32 insertions, 0 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 83525e3..8efa202 100755
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -293,6 +293,7 @@ int g_supplicant_interface_disconnect(GSupplicantInterface *interface,
#if defined TIZEN_EXT
int g_supplicant_interface_remove_network(GSupplicantInterface *interface);
+int g_supplicant_interface_get_disconnect_reason(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 6fb9c7b..89591fe 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -181,6 +181,9 @@ struct _GSupplicantInterface {
GHashTable *bss_mapping;
void *data;
const char *pending_peer_path;
+#if defined TIZEN_EXT
+ int disconnect_reason;
+#endif
};
struct g_supplicant_bss {
@@ -2280,6 +2283,17 @@ static void interface_property(const char *key, DBusMessageIter *iter,
} else if (g_strcmp0(key, "Networks") == 0) {
supplicant_dbus_array_foreach(iter, interface_network_added,
interface);
+#if defined TIZEN_EXT
+ } else if (g_strcmp0(key, "DisconnectReason") == 0) {
+ int disconnect_reason = 0;
+
+ dbus_message_iter_get_basic(iter, &disconnect_reason);
+ interface->disconnect_reason = disconnect_reason;
+
+ SUPPLICANT_DBG("disconnect reason (%d)",
+ interface->disconnect_reason);
+
+#endif
} else
SUPPLICANT_DBG("key %s type %c",
key, dbus_message_iter_get_arg_type(iter));
@@ -5651,6 +5665,23 @@ int g_supplicant_interface_remove_network(GSupplicantInterface *interface)
return network_remove(data);
}
+
+int g_supplicant_interface_get_disconnect_reason(GSupplicantInterface *interface)
+{
+ int reason_code = 0;
+
+ SUPPLICANT_DBG("");
+
+ if (interface == NULL)
+ return -EINVAL;
+
+ if (system_available == FALSE)
+ return -EFAULT;
+
+ reason_code = interface->disconnect_reason;
+
+ return reason_code;
+}
#endif
static const char *g_supplicant_rule0 = "type=signal,"