diff options
author | taesub kim <taesub.kim@samsung.com> | 2017-03-02 16:45:31 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.vlan103.tizen.org> | 2017-03-02 16:45:31 -0800 |
commit | 9100e6d1a937cb6e2b2206cd23a5f88fa69a2a0f (patch) | |
tree | 0efbb832439fa5212739d85b4d577e7021010c15 /gsupplicant/supplicant.c | |
parent | 22d9b6aab2ea06c1e4fc3ae0ff58e78976dc818c (diff) | |
parent | 2e8645c8115381bd1b76876f8a4a7b31640cc239 (diff) | |
download | connman-fedc708301832241e41a8b184aa6fc7597cbedc2.tar.gz connman-fedc708301832241e41a8b184aa6fc7597cbedc2.tar.bz2 connman-fedc708301832241e41a8b184aa6fc7597cbedc2.zip |
Merge "[tizen 4.0]: Add support of Disconnect Reason Event Handler" into tizensubmit/tizen_unified/20170308.100411submit/tizen/20170303.005553accepted/tizen/wearable/20170303.065623accepted/tizen/unified/20170309.035138accepted/tizen/tv/20170303.065605accepted/tizen/mobile/20170303.065550accepted/tizen/ivi/20170303.065637accepted/tizen/common/20170303.090745
Diffstat (limited to 'gsupplicant/supplicant.c')
-rwxr-xr-x | gsupplicant/supplicant.c | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index c596619a..50b0e67a 100755 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -559,6 +559,20 @@ static void callback_peer_request(GSupplicantPeer *peer) callbacks_pointer->peer_request(peer); } +static void callback_disconnect_reason_code(GSupplicantInterface *interface, + int reason_code) +{ + if (!callbacks_pointer) + return; + + if (!callbacks_pointer->disconnect_reasoncode) + return; + + if (reason_code != 0) + callbacks_pointer->disconnect_reasoncode(interface, + reason_code); +} + static void remove_group(gpointer data) { GSupplicantGroup *group = data; @@ -2288,17 +2302,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); -#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 + int reason_code; + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_INVALID) { + dbus_message_iter_get_basic(iter, &reason_code); + callback_disconnect_reason_code(interface, reason_code); + } } else SUPPLICANT_DBG("key %s type %c", key, dbus_message_iter_get_arg_type(iter)); @@ -5705,23 +5714,6 @@ 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," |