WPA Supplicant "DisconnectReason" carries the IEEE 802.11 reason
code of the most recent disassociation or deauthentication event.
---
gsupplicant/supplicant.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 81fcadc..a9128dc 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -182,6 +182,7 @@ struct _GSupplicantInterface {
GHashTable *bss_mapping;
void *data;
const char *pending_peer_path;
+ int disconnect_reason;
};
struct g_supplicant_bss {
@@ -2107,6 +2108,12 @@ 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);
+ } else if (g_strcmp0(key, "DisconnectReason") == 0) {
+ int reason = 0;
+
+ dbus_message_iter_get_basic(iter, &reason);
+ SUPPLICANT_DBG("Disconnect Reason %d", reason);
+ interface->disconnect_reason = reason;
} else
SUPPLICANT_DBG("key %s type %c",
key, dbus_message_iter_get_arg_type(iter));
--
1.9.1
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman