diff options
author | hyunuktak <hyunuk.tak@samsung.com> | 2015-09-01 15:28:13 +0900 |
---|---|---|
committer | hyunuktak <hyunuk.tak@samsung.com> | 2015-09-08 10:02:40 +0900 |
commit | bd649ff715ebfc04420de52b68910b4cb45aab2d (patch) | |
tree | 868b82e23fce93e72b16e0144c749ca50ff8e294 | |
parent | 4618ae387449532352df1106ae5f6ad132fbe30c (diff) | |
download | wifi-bd649ff715ebfc04420de52b68910b4cb45aab2d.tar.gz wifi-bd649ff715ebfc04420de52b68910b4cb45aab2d.tar.bz2 wifi-bd649ff715ebfc04420de52b68910b4cb45aab2d.zip |
Modify how to check the supported featuresubmit/tizen/20150908.040635accepted/tizen/wearable/20150908.073902accepted/tizen/tv/20150908.073920accepted/tizen/mobile/20150908.073842
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
Change-Id: Id1cd5e1d410d25c1cf194b490a2bf76aa076009e
-rwxr-xr-x | include/net_wifi_private.h | 15 | ||||
-rwxr-xr-x | src/libnetwork.c | 27 |
2 files changed, 32 insertions, 10 deletions
diff --git a/include/net_wifi_private.h b/include/net_wifi_private.h index 8f3c072..c0c7848 100755 --- a/include/net_wifi_private.h +++ b/include/net_wifi_private.h @@ -40,16 +40,9 @@ extern "C" { #if !defined TIZEN_TV #define CHECK_FEATURE_SUPPORTED(feature_name) \ do { \ - bool feature_supported = FALSE; \ - if (!system_info_get_platform_bool(feature_name, &feature_supported)) { \ - if (feature_supported == FALSE) { \ - LOGE("%s feature is disabled", feature_name); \ - return WIFI_ERROR_NOT_SUPPORTED; \ - } \ - } else { \ - LOGE("Error - Feature getting from System Info"); \ - return WIFI_ERROR_OPERATION_FAILED; \ - } \ + int rv = _wifi_check_feature_supported(feature_name); \ + if( rv != WIFI_ERROR_NONE ) \ + return rv; \ } while(0) #else #define CHECK_FEATURE_SUPPORTED(feature_name) @@ -125,6 +118,8 @@ wifi_connection_state_e _wifi_convert_to_ap_state(net_state_type_t state); guint _wifi_callback_add(GSourceFunc func, gpointer user_data); void _wifi_callback_cleanup(void); +int _wifi_check_feature_supported(const char *feature_name); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/src/libnetwork.c b/src/libnetwork.c index 7ff72c5..113145c 100755 --- a/src/libnetwork.c +++ b/src/libnetwork.c @@ -65,6 +65,8 @@ static __thread struct _wifi_cb_s wifi_callbacks = { 0, }; static __thread struct _profile_list_s profile_iterator = { 0, NULL }; static __thread struct _profile_list_s specific_profile_iterator = {0, NULL}; static __thread char specific_profile_essid[NET_WLAN_ESSID_LEN + 1] = { 0, }; +static __thread bool is_feature_checked = false; +static __thread bool feature_supported = false; static __thread GSList *managed_idler_list = NULL; bool _wifi_is_init(void) @@ -1330,3 +1332,28 @@ void _wifi_callback_cleanup(void) g_slist_free(managed_idler_list); managed_idler_list = NULL; } + +int _wifi_check_feature_supported(const char *feature_name) +{ + if(is_feature_checked) { + if(!feature_supported) { + LOGE("%s feature is disabled", feature_name); + return WIFI_ERROR_NOT_SUPPORTED; + } + } + else { + if (!system_info_get_platform_bool(feature_name, &feature_supported)) { + is_feature_checked = true; + if (!feature_supported) { + LOGE("%s feature is disabled", feature_name); + return WIFI_ERROR_NOT_SUPPORTED; + } + } + else { + LOGE("Error - Feature getting from System Info"); + return WIFI_ERROR_OPERATION_FAILED; + } + } + + return WIFI_ERROR_NONE; +} |