From 5b04daf30f54e0728d91a65d71e1dc6a47075a11 Mon Sep 17 00:00:00 2001 From: Maneesh Jain Date: Thu, 26 Oct 2017 17:27:35 +0530 Subject: Added handling of "AssocStatusCode" signal Description : This can be used by application in case AP is denying association with status code Change-Id: I195492be4320032b460b708034f044eec03b71dd Signed-off-by: Maneesh Jain --- gsupplicant/gsupplicant.h | 2 ++ gsupplicant/supplicant.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'gsupplicant') diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h index f115c5e5..a33dab0f 100755 --- a/gsupplicant/gsupplicant.h +++ b/gsupplicant/gsupplicant.h @@ -410,6 +410,8 @@ struct _GSupplicantCallbacks { void (*debug) (const char *str); void (*disconnect_reasoncode)(GSupplicantInterface *interface, int reasoncode); + void (*assoc_status_code)(GSupplicantInterface *interface, + int reasoncode); }; typedef struct _GSupplicantCallbacks GSupplicantCallbacks; diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index f3f2b403..b1232a5d 100755 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -577,6 +577,19 @@ static void callback_disconnect_reason_code(GSupplicantInterface *interface, reason_code); } +static void callback_assoc_status_code(GSupplicantInterface *interface, + int status_code) +{ + if (!callbacks_pointer) + return; + + if (!callbacks_pointer->assoc_status_code) + return; + + callbacks_pointer->assoc_status_code(interface, status_code); + +} + static void remove_group(gpointer data) { GSupplicantGroup *group = data; @@ -2359,6 +2372,12 @@ static void interface_property(const char *key, DBusMessageIter *iter, dbus_message_iter_get_basic(iter, &reason_code); callback_disconnect_reason_code(interface, reason_code); } + } else if (g_strcmp0(key, "AssocStatusCode") == 0) { + int status_code; + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_INVALID) { + dbus_message_iter_get_basic(iter, &status_code); + callback_assoc_status_code(interface, status_code); + } } else SUPPLICANT_DBG("key %s type %c", key, dbus_message_iter_get_arg_type(iter)); -- cgit v1.2.3