diff options
author | taesub kim <taesub.kim@samsung.com> | 2018-01-22 05:52:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.ap-northeast-2.compute.internal> | 2018-01-22 05:52:51 +0000 |
commit | a079cfe6f815f8c69055de834d1ccbdf1fd94ba7 (patch) | |
tree | 3d64db87050fd34c2fd502c1c14fdc0c63263e8d /src | |
parent | e2d7fb2f0a93e6af36870f0d79e4373108aa5375 (diff) | |
parent | 3210aec76f77e83630367d47b888db89baec44c4 (diff) | |
download | connman-a079cfe6f815f8c69055de834d1ccbdf1fd94ba7.tar.gz connman-a079cfe6f815f8c69055de834d1ccbdf1fd94ba7.tar.bz2 connman-a079cfe6f815f8c69055de834d1ccbdf1fd94ba7.zip |
Merge "Modified logic to process each VSIE of all vendors." into tizensubmit/tizen/20180122.055447submit/tizen/20180122.055424accepted/tizen/unified/20180123.061054
Diffstat (limited to 'src')
-rwxr-xr-x | src/network.c | 48 | ||||
-rwxr-xr-x | src/service.c | 23 |
2 files changed, 44 insertions, 27 deletions
diff --git a/src/network.c b/src/network.c index 5aac8d6a..f7a9925a 100755 --- a/src/network.c +++ b/src/network.c @@ -109,8 +109,7 @@ struct connman_network { bool rsn_mode; int disconnect_reason; int assoc_status_code; - void *wifi_vsie; - unsigned int wifi_vsie_len; + GSList *vsie_list; #endif } wifi; @@ -971,7 +970,7 @@ static void network_destruct(struct connman_network *network) g_free(network->wifi.phase2_auth); g_free(network->wifi.pin_wps); #if defined TIZEN_EXT - g_free(network->wifi.wifi_vsie); + g_slist_free_full(network->wifi.vsie_list, g_free); #endif g_free(network->path); g_free(network->group); @@ -2395,6 +2394,31 @@ bool connman_network_get_bool(struct connman_network *network, return false; } +#if defined TIZEN_EXT +/** + * connman_network_set_vsie_list: + * @network: network structure + * @vsie_list: GSList pointer + * + * Set vendor specific list pointer + */ +void connman_network_set_vsie_list(struct connman_network *network, GSList *vsie_list) +{ + network->wifi.vsie_list = vsie_list; +} + +/** + * connman_network_get_vsie_list: + * @network: network structure + * + * Get vendor specific list pointer + */ +void *connman_network_get_vsie_list(struct connman_network *network) +{ + return network->wifi.vsie_list; +} +#endif + /** * connman_network_set_blob: * @network: network structure @@ -2419,16 +2443,6 @@ int connman_network_set_blob(struct connman_network *network, network->wifi.ssid_len = size; } else network->wifi.ssid_len = 0; -#if defined TIZEN_EXT - } else if (g_str_equal(key, "WiFi.Vsie")){ - g_free(network->wifi.wifi_vsie); - network->wifi.wifi_vsie = g_try_malloc(size); - if (network->wifi.wifi_vsie) { - memcpy(network->wifi.wifi_vsie, data, size); - network->wifi.wifi_vsie_len = size; - } else - network->wifi.wifi_vsie_len = 0; -#endif } else { return -EINVAL; } @@ -2457,14 +2471,6 @@ const void *connman_network_get_blob(struct connman_network *network, return network->wifi.ssid; } -#if defined TIZEN_EXT - if (g_str_equal(key, "WiFi.Vsie")) { - if (size) - *size = network->wifi.wifi_vsie_len; - return network->wifi.wifi_vsie; - } -#endif - return NULL; } diff --git a/src/service.c b/src/service.c index 129b4105..033c8f8f 100755 --- a/src/service.c +++ b/src/service.c @@ -3248,14 +3248,25 @@ static void append_properties(DBusMessageIter *dict, dbus_bool_t limited, connman_dbus_dict_append_basic(dict, "Frequency", DBUS_TYPE_UINT16, &frequency); } - const void *wifi_vsie; + + unsigned char *wifi_vsie; unsigned int wifi_vsie_len; - wifi_vsie = connman_network_get_blob(service->network, "WiFi.Vsie", &wifi_vsie_len); - if(wifi_vsie_len > 0) { - DBG("ConnMan, service->path=%s vsie length=%d", service->path, wifi_vsie_len); + GSList *vsie_list = NULL; + + if (service->network) + vsie_list = (GSList *)connman_network_get_vsie_list(service->network); + + if (vsie_list) { + DBG("ConnMan, service->path=%s No.of elements in list: %d", service->path, g_slist_length(vsie_list)); + GSList *list; + for (list = vsie_list; list; list = list->next) { + wifi_vsie = (unsigned char *)list->data; + wifi_vsie_len = wifi_vsie[1] + 2; + + connman_dbus_dict_append_fixed_array(dict, "Vsie", DBUS_TYPE_BYTE, + &wifi_vsie, wifi_vsie_len); + } } - connman_dbus_dict_append_fixed_array(dict, "Vsie", DBUS_TYPE_BYTE, - &wifi_vsie, wifi_vsie_len); #endif str = __connman_service_type2string(service->type); |