X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=plugin%2Fwpasupplicant%2Fctrl_iface_dbus%2Fwfd-plugin-wpasupplicant.c;h=9b21cf7aa8effd7af3680bad575ed3f4048050a7;hb=a4c53f3f5ce247293257c5da489198a6030eeb5f;hp=06b1ba084a90c7c09592d6d27b30c0a9a402985c;hpb=74d80822db288cc037ab2bfd15bbbea036fcecc8;p=platform%2Fcore%2Fconnectivity%2Fwifi-direct-manager.git diff --git a/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c b/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c index 06b1ba0..9b21cf7 100644 --- a/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c +++ b/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c @@ -632,6 +632,9 @@ static int _ws_get_local_dev_mac(unsigned char *dev_mac) return 0; } +static void _ws_manage_group_iface_signal(const gchar *group_iface_obj_path, + gboolean is_created); + static void _ws_process_interface_removed(GDBusConnection *connection, const gchar *sender, const gchar *object_path, const gchar *interface, const gchar *signal, GVariant *parameters, gpointer user_data) @@ -1232,9 +1235,12 @@ void __ws_extract_group_details(const char *key, GVariant *value, void *user_dat g_strlcpy(interface_path, i_path, DBUS_OBJECT_PATH_MAX); WDP_LOGD("Retrive Added path [%s]", interface_path); g_strlcpy(g_pd->group_iface_path, interface_path, DBUS_OBJECT_PATH_MAX); + dbus_property_get_all(interface_path, g_pd->g_dbus, SUPPLICANT_IFACE, __ws_interface_property, event); + _ws_manage_group_iface_signal(interface_path, TRUE); + } else if (g_strcmp0(key, "role") == 0) { const char *role = NULL; @@ -2864,6 +2870,8 @@ static void _ws_process_group_finished(GDBusConnection *connection, g_dbus_connection_signal_unsubscribe(g_pd->g_dbus, ws_group_signal_map[i].sub_id); ws_group_signal_map[i].sub_id = 0; } + + _ws_manage_group_iface_signal(interface, FALSE); memset(g_pd->group_iface_path, 0x0, DBUS_OBJECT_PATH_MAX); _ws_flush(); @@ -3506,6 +3514,34 @@ static struct { } }; +static struct { + int sub_id; + const char *interface; + const char *member; + void (*function) (GDBusConnection *connection, + const gchar *sender, const gchar *object_path, const gchar *interface, + const gchar *signal, GVariant *parameters, gpointer user_data); +} ws_group_interface_signal_map[] = { + { + 0, + SUPPLICANT_IFACE, + "StaAuthorized", + _ws_process_sta_authorized + }, + { + 0, + SUPPLICANT_IFACE, + "StaDeauthorized", + _ws_process_sta_deauthorized + }, + { + 0, + NULL, + NULL, + NULL + } +}; + static void __register_p2pdevice_signal(GVariant *value, void *user_data) { __WDP_LOG_FUNC_ENTER__; @@ -3791,6 +3827,52 @@ static int _ws_deinit_dbus_connection(void) return 0; } +static void _ws_manage_group_iface_signal(const gchar *group_iface_obj_path, + gboolean is_created) +{ + __WDP_LOG_FUNC_ENTER__; + GDBusConnection *connection; + + if (!g_pd) { + WDP_LOGD("Ignore"); + __WDP_LOG_FUNC_EXIT__; + return; + } + + if (!g_strcmp0(g_pd->iface_path, group_iface_obj_path)) { + WDP_LOGD("group iface is p2p iface, ignore"); + __WDP_LOG_FUNC_EXIT__; + return; + } + + connection = g_pd->g_dbus; + int i; + if (is_created) { + /* subscribe Interface iface signal */ + for (i = 0; ws_group_interface_signal_map[i].member != NULL; i++) { + ws_group_interface_signal_map[i].sub_id = + g_dbus_connection_signal_subscribe(connection, + SUPPLICANT_SERVICE, /* bus name */ + ws_group_interface_signal_map[i].interface, /* interface */ + ws_group_interface_signal_map[i].member, /* member */ + group_iface_obj_path, /* object path */ + NULL, /* arg0 */ + G_DBUS_SIGNAL_FLAGS_NONE, + ws_group_interface_signal_map[i].function, + NULL, NULL); + WDP_LOGD("Subscribed Interface iface signal [%s]", ws_group_interface_signal_map[i].member); + } + + } else { + for (i = 0; ws_group_interface_signal_map[i].member != NULL; i++) { + g_dbus_connection_signal_unsubscribe(connection, ws_group_interface_signal_map[i].sub_id); + ws_group_interface_signal_map[i].sub_id = 0; + } + } + __WDP_LOG_FUNC_EXIT__; + return; +} + int wfd_plugin_load(wfd_oem_ops_s **ops) { __WDP_LOG_FUNC_ENTER__;