From 553349ebebc46074c1b86f08aba17e5dd2fd2bcd Mon Sep 17 00:00:00 2001 From: Nishant Chaprana Date: Fri, 27 May 2016 12:39:58 +0530 Subject: [PATCH] [Support Persistent Group] Identify whether created group is persistent or not. Change-Id: I454a4ab86d1815c56ec213413707877490afb4cb Signed-off-by: Nishant Chaprana --- oem/wifi-direct-oem.h | 1 + packaging/wifi-direct-manager.spec | 2 +- plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c | 4 ++++ .../wpasupplicant/ctrl_iface_sock/include/wfd-plugin-wpasupplicant.h | 1 + plugin/wpasupplicant/ctrl_iface_sock/wfd-plugin-wpasupplicant.c | 5 +++++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/oem/wifi-direct-oem.h b/oem/wifi-direct-oem.h index 080bb00..a4a9bee 100755 --- a/oem/wifi-direct-oem.h +++ b/oem/wifi-direct-oem.h @@ -242,6 +242,7 @@ typedef struct { typedef struct { char ssid[OEM_DEV_NAME_LEN+1]; int freq; + int is_persistent; char pass[OEM_PASS_PHRASE_LEN+1]; unsigned char go_dev_addr[OEM_MACADDR_LEN]; #ifdef TIZEN_FEATURE_IP_OVER_EAPOL diff --git a/packaging/wifi-direct-manager.spec b/packaging/wifi-direct-manager.spec index 11bfa94..57e62b5 100755 --- a/packaging/wifi-direct-manager.spec +++ b/packaging/wifi-direct-manager.spec @@ -1,6 +1,6 @@ Name: wifi-direct-manager Summary: Wi-Fi Direct manger -Version: 1.2.162 +Version: 1.2.163 Release: 1 Group: Network & Connectivity/Wireless License: Apache-2.0 diff --git a/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c b/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c index a9a5567..e9b4088 100755 --- a/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c +++ b/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c @@ -924,6 +924,10 @@ void __ws_extract_group_details(const char *key, GVariant *value, void *user_dat event->dev_role = WFD_OEM_DEV_ROLE_GO; else if (!strncmp(role, "client", 6)) event->dev_role = WFD_OEM_DEV_ROLE_GC; + } else if (g_strcmp0(key, "persistent") == 0) { + g_variant_get(value, "b", &group->is_persistent); + WDP_LOGD("Is Persistent : [%s]", group->is_persistent?"YES":"NO"); + #ifdef TIZEN_FEATURE_IP_OVER_EAPOL } else if (g_strcmp0(key, "IpAddr") == 0) { diff --git a/plugin/wpasupplicant/ctrl_iface_sock/include/wfd-plugin-wpasupplicant.h b/plugin/wpasupplicant/ctrl_iface_sock/include/wfd-plugin-wpasupplicant.h index 8d99645..b1b14f1 100755 --- a/plugin/wpasupplicant/ctrl_iface_sock/include/wfd-plugin-wpasupplicant.h +++ b/plugin/wpasupplicant/ctrl_iface_sock/include/wfd-plugin-wpasupplicant.h @@ -283,6 +283,7 @@ typedef enum { WS_GROUP_INFO_PASS, // passphrase= WS_GROUP_INFO_GO_DEV_ADDR, // go_dev_addr= WS_GROUP_INFO_STATUS, // status= + WS_GROUP_INFO_PERSISTENT, // [PERSISTENT] #ifdef TIZEN_FEATURE_IP_OVER_EAPOL WS_GROUP_INFO_IP_ADDR, //ip_addr= WS_GROUP_INFO_IP_MASK, //ip_mask= diff --git a/plugin/wpasupplicant/ctrl_iface_sock/wfd-plugin-wpasupplicant.c b/plugin/wpasupplicant/ctrl_iface_sock/wfd-plugin-wpasupplicant.c index 48ebc94..9f850a3 100755 --- a/plugin/wpasupplicant/ctrl_iface_sock/wfd-plugin-wpasupplicant.c +++ b/plugin/wpasupplicant/ctrl_iface_sock/wfd-plugin-wpasupplicant.c @@ -155,6 +155,7 @@ ws_string_s ws_group_info_strs[] = { {"passphrase", WS_GROUP_INFO_PASS}, {"go_dev_addr", WS_GROUP_INFO_GO_DEV_ADDR}, {"status", WS_GROUP_INFO_STATUS}, + {"[PERSISTENT]", WS_GROUP_INFO_PERSISTENT}, #ifdef TIZEN_FEATURE_IP_OVER_EAPOL {"ip_addr", WS_GROUP_INFO_IP_ADDR}, {"ip_mask", WS_GROUP_INFO_IP_MASK}, @@ -1677,6 +1678,10 @@ static wfd_oem_group_data_s *_convert_msg_to_group_info(char *msg) if (res < 0) memset(edata->go_dev_addr, 0x00, OEM_MACADDR_LEN); break; + case WS_GROUP_INFO_PERSISTENT: + edata->is_persistent = TRUE; + WDP_LOGD("Is Persistent : [%s]", edata->is_persistent?"YES":"NO"); + break; #ifdef TIZEN_FEATURE_IP_OVER_EAPOL case WS_GROUP_INFO_IP_ADDR: WDP_LOGD("Extracted peer ip = %s", infos[i].string); -- 2.7.4