summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhyunuktak <hyunuk.tak@samsung.com>2015-09-01 15:28:13 +0900
committerhyunuktak <hyunuk.tak@samsung.com>2015-09-08 10:02:40 +0900
commitbd649ff715ebfc04420de52b68910b4cb45aab2d (patch)
tree868b82e23fce93e72b16e0144c749ca50ff8e294
parent4618ae387449532352df1106ae5f6ad132fbe30c (diff)
downloadwifi-bd649ff715ebfc04420de52b68910b4cb45aab2d.tar.gz
wifi-bd649ff715ebfc04420de52b68910b4cb45aab2d.tar.bz2
wifi-bd649ff715ebfc04420de52b68910b4cb45aab2d.zip
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com> Change-Id: Id1cd5e1d410d25c1cf194b490a2bf76aa076009e
-rwxr-xr-xinclude/net_wifi_private.h15
-rwxr-xr-xsrc/libnetwork.c27
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;
+}