Apply coding rule 09/53709/1
authorhyunuktak <hyunuk.tak@samsung.com>
Wed, 9 Dec 2015 01:35:35 +0000 (10:35 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Wed, 9 Dec 2015 01:38:39 +0000 (10:38 +0900)
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
Change-Id: I77003cafc3a00d82703b16d7faa1be643a70ecf1

packaging/capi-network-wifi.spec
src/libnetwork.c
src/net_wifi.c
src/net_wifi_ap.c
src/net_wifi_config.c [changed mode: 0644->0755]
src/wifi_config.c [changed mode: 0644->0755]
src/wifi_dbus.c [changed mode: 0644->0755]
test/wifi_test.c

index d0e274f..320c84b 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-wifi
 Summary:       Network Wi-Fi library in TIZEN C API
-Version:       1.0.60
+Version:       1.0.61
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index bae7d92..1118035 100755 (executable)
@@ -205,12 +205,11 @@ static int __libnet_update_profile_iterator(void)
 
 static void __libnet_update_specific_profile_iterator(GSList *ap_list)
 {
-    int count=0;
-    GSList *list = ap_list;
+       int count = 0;
+       GSList *list = ap_list;
 
-    for (count = 0; list; list = list->next) {
+       for (count = 0; list; list = list->next)
                count++;
-    }
 
        if (count == 0) {
                WIFI_LOG(WIFI_INFO, "No hidden AP found\n");
@@ -626,7 +625,7 @@ static void __libnet_evt_cb(net_event_info_t *event_cb, void *user_data)
                        return;
                case NET_ERR_ACTIVE_CONNECTION_EXISTS:
                        return;
-               default :
+               default:
                        break;
                }
 
@@ -718,7 +717,7 @@ static void __libnet_evt_cb(net_event_info_t *event_cb, void *user_data)
        case NET_EVENT_WIFI_POWER_IND:
                __libnet_power_on_off_cb(event_cb, is_requested);
                break;
-       default :
+       default:
                break;
        }
 }
@@ -955,12 +954,12 @@ int _wifi_libnet_scan_request(wifi_scan_finished_cb callback, void *user_data)
 }
 
 int _wifi_libnet_scan_specific_ap(const char *essid,
-                                       wifi_scan_finished_cb callback, void *user_data)
+                                                       wifi_scan_finished_cb callback, void *user_data)
 {
        int rv;
-    rv = net_specific_scan_wifi(essid);
+       rv = net_specific_scan_wifi(essid);
 
-    if (rv == NET_ERR_NONE) {
+       if (rv == NET_ERR_NONE) {
                g_strlcpy(specific_profile_essid, essid, NET_WLAN_ESSID_LEN+1);
                __libnet_set_specific_scan_cb(callback, user_data);
                return WIFI_ERROR_NONE;
@@ -1337,21 +1336,19 @@ void _wifi_callback_cleanup(void)
 
 int _wifi_check_feature_supported(const char *feature_name)
 {
-       if(is_feature_checked) {
-               if(!feature_supported) {
+       if (is_feature_checked) {
+               if (!feature_supported) {
                        LOGE("%s feature is disabled", feature_name);
                        return WIFI_ERROR_NOT_SUPPORTED;
                }
-       }
-       else {
+       } 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 {
+               } else {
                        LOGE("Error - Feature getting from System Info");
                        return WIFI_ERROR_OPERATION_FAILED;
                }
index 4095564..2635d0a 100755 (executable)
@@ -70,8 +70,7 @@ EXPORT_API int wifi_initialize(void)
        if (rv == NET_ERR_ACCESS_DENIED) {
                WIFI_LOG(WIFI_ERROR, "Access denied");
                return WIFI_ERROR_PERMISSION_DENIED;
-       }
-       else if (rv != NET_ERR_NONE) {
+       } else if (rv != NET_ERR_NONE) {
                WIFI_LOG(WIFI_ERROR, "Init failed[%d]", rv);
                return WIFI_ERROR_OPERATION_FAILED;
        }
index 49a83ca..234bf82 100755 (executable)
@@ -443,11 +443,10 @@ EXPORT_API int wifi_ap_get_ip_config_type(wifi_ap_h ap, wifi_address_family_e ad
 
        net_profile_info_t *profile_info = ap;
 
-       if (address_family == WIFI_ADDRESS_FAMILY_IPV4){
+       if (address_family == WIFI_ADDRESS_FAMILY_IPV4)
                profileType = profile_info->ProfileInfo.Wlan.net_info.IpConfigType ;
-       } else {
+       else
                profileType = profile_info->ProfileInfo.Wlan.net_info.IpConfigType6 ;
-       }
 
        if (address_family == WIFI_ADDRESS_FAMILY_IPV4) {
                switch (profileType) {
@@ -507,11 +506,10 @@ EXPORT_API int wifi_ap_set_ip_config_type(wifi_ap_h ap, wifi_address_family_e ad
 
        net_profile_info_t *profile_info = ap;
 
-       if (address_family == WIFI_ADDRESS_FAMILY_IPV4) {
+       if (address_family == WIFI_ADDRESS_FAMILY_IPV4)
                profileType = &profile_info->ProfileInfo.Wlan.net_info.IpConfigType ;
-       } else {
+       else
                profileType = &profile_info->ProfileInfo.Wlan.net_info.IpConfigType6 ;
-       }
 
        if (address_family == WIFI_ADDRESS_FAMILY_IPV4) {
                switch (type) {
@@ -679,7 +677,7 @@ EXPORT_API int wifi_ap_set_subnet_mask(wifi_ap_h ap, wifi_address_family_e addre
         * For IPv6 address subnet mask is prefix length, an integer,  while for
         * Ipv6 address subnet mask is a ipv6 address.
         */
-       if (address_family == WIFI_ADDRESS_FAMILY_IPV6){
+       if (address_family == WIFI_ADDRESS_FAMILY_IPV6) {
                if (subnet_mask == NULL)
                        profile_info->ProfileInfo.Wlan.net_info.PrefixLen6 = 0;
                else {
@@ -877,7 +875,7 @@ EXPORT_API int wifi_ap_set_proxy_type(wifi_ap_h ap, wifi_proxy_type_e proxy_type
        if (_wifi_libnet_check_profile_name_validity(profile_info->ProfileName) == false)
                return WIFI_ERROR_NONE;
 
-       rv =_wifi_update_ap_info(profile_info);
+       rv = _wifi_update_ap_info(profile_info);
        if (rv != NET_ERR_NONE && proxy_type == WIFI_PROXY_TYPE_MANUAL) {
                g_strlcpy(profile_info->ProfileInfo.Wlan.net_info.ProxyAddr, "0.0.0.0:8080", 15);
                rv = _wifi_update_ap_info(profile_info);
@@ -902,7 +900,7 @@ EXPORT_API int wifi_ap_get_dns_address(wifi_ap_h ap, int order, wifi_address_fam
 
        net_profile_info_t *profile_info = ap;
 
-       if(address_family == WIFI_ADDRESS_FAMILY_IPV4)
+       if (address_family == WIFI_ADDRESS_FAMILY_IPV4)
                *dns_address = __ap_convert_ip_to_string(
                                &profile_info->ProfileInfo.Wlan.net_info.DnsAddr[order-1],
                                address_family);
@@ -1213,7 +1211,7 @@ EXPORT_API int wifi_ap_get_eap_passphrase(wifi_ap_h ap, char** user_name, bool*
 {
        CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
 
-       if (_wifi_libnet_check_ap_validity(ap) == false ||user_name == NULL || is_password_set == NULL) {
+       if (_wifi_libnet_check_ap_validity(ap) == false || user_name == NULL || is_password_set == NULL) {
                WIFI_LOG(WIFI_ERROR, "Invalid parameter");
                return WIFI_ERROR_INVALID_PARAMETER;
        }
old mode 100644 (file)
new mode 100755 (executable)
index 08d439d..98692d7
@@ -180,15 +180,12 @@ EXPORT_API int wifi_config_save_configuration(wifi_config_h config)
 
        if (h->security_type == WIFI_SECURITY_TYPE_EAP) {
                ret = wifi_save_eap_configurations(dbus_h, h->name, h->passphrase, h->security_type, h->proxy_address, h->eap_config, h->is_hidden);
-               if (ret != WIFI_ERROR_NONE) {
+               if (ret != WIFI_ERROR_NONE)
                        WIFI_LOG(WIFI_ERROR, "Fail to wifi_save_eap_configurations");
-               }
-       }
-       else {
+       } else {
                ret = wifi_save_configurations(dbus_h, h->name, h->passphrase, h->security_type, h->proxy_address, h->is_hidden);
-               if (ret != WIFI_ERROR_NONE) {
+               if (ret != WIFI_ERROR_NONE)
                        WIFI_LOG(WIFI_ERROR, "Fail to save configurations [%d]", ret);
-               }
        }
 
        h->is_saved = TRUE;
@@ -245,8 +242,7 @@ EXPORT_API int wifi_config_foreach_configuration(wifi_config_list_cb callback, v
                        }
                        ret = wifi_load_eap_configurations(dbus_h, id, &h->name,
                                &h->security_type, &h->proxy_address, &h->is_hidden, &h->eap_config, &h->last_error);
-               }
-               else {
+               } else {
                        ret = wifi_load_configurations(dbus_h, id, &h->name,
                                &h->security_type, &h->proxy_address, &h->is_hidden, &h->last_error);
                }
@@ -374,9 +370,8 @@ EXPORT_API int wifi_config_set_proxy_address(wifi_config_h config, wifi_address_
                config_id = wifi_config_get_config_id(h->name, h->security_type);
 
                ret = wifi_configuration_set_field(dbus_h, config_id, WIFI_CONFIG_PROXYADDRESS, proxy_address);
-               if (ret != WIFI_ERROR_NONE) {
+               if (ret != WIFI_ERROR_NONE)
                        WIFI_LOG(WIFI_ERROR, "Fail to set proxy address [%d]", ret);
-               }
 
                g_free(config_id);
        }
@@ -438,15 +433,14 @@ EXPORT_API int wifi_config_set_hidden_ap_property(wifi_config_h config, bool hid
 
                config_id = wifi_config_get_config_id(h->name, h->security_type);
 
-               if (h->is_hidden == TRUE) {
+               if (h->is_hidden == TRUE)
                        hidden = g_strdup("TRUE");
-               } else {
+               else
                        hidden = g_strdup("FALSE");
-               }
+
                ret = wifi_configuration_set_field(dbus_h, config_id, WIFI_CONFIG_HIDDEN, hidden);
-               if (ret != WIFI_ERROR_NONE) {
+               if (ret != WIFI_ERROR_NONE)
                        WIFI_LOG(WIFI_ERROR, "Fail to set hidden [%d]", ret);
-               }
 
                g_free(hidden);
                g_free(config_id);
old mode 100644 (file)
new mode 100755 (executable)
index 6427ca2..172fede
@@ -103,9 +103,8 @@ static gchar *_wifi_change_name_to_hexadecimal(const gchar *name)
        gint length = 0;
        gchar *hex = NULL;
 
-       if (name == NULL) {
+       if (name == NULL)
                return NULL;
-       }
 
        length = strlen(name);
 
@@ -113,9 +112,8 @@ static gchar *_wifi_change_name_to_hexadecimal(const gchar *name)
        if (string == NULL)
                return NULL;
 
-       for (i = 0; i < length; i++) {
+       for (i = 0; i < length; i++)
                g_string_append_printf(string, "%02x", name[i]);
-       }
 
        hex = g_strdup_printf("%s", string->str);
        g_string_free(string, TRUE);
@@ -127,22 +125,22 @@ gchar *wifi_eap_type_to_string(wifi_eap_type_e eap_type)
 {
        gchar *type = NULL;
 
-       switch(eap_type) {
-               case WIFI_EAP_TYPE_PEAP:
-                       type = g_strdup("PEAP");
-                       break;
-               case WIFI_EAP_TYPE_TLS:
-                       type = g_strdup("TLS");
-                       break;
-               case WIFI_EAP_TYPE_TTLS:
-                       type = g_strdup("TTLS");
-                       break;
-               case WIFI_EAP_TYPE_SIM:
-                       type = g_strdup("SIM");
-                       break;
-               case WIFI_EAP_TYPE_AKA:
-                       type = g_strdup("AKA");
-                       break;
+       switch (eap_type) {
+       case WIFI_EAP_TYPE_PEAP:
+               type = g_strdup("PEAP");
+               break;
+       case WIFI_EAP_TYPE_TLS:
+               type = g_strdup("TLS");
+               break;
+       case WIFI_EAP_TYPE_TTLS:
+               type = g_strdup("TTLS");
+               break;
+       case WIFI_EAP_TYPE_SIM:
+               type = g_strdup("SIM");
+               break;
+       case WIFI_EAP_TYPE_AKA:
+               type = g_strdup("AKA");
+               break;
        }
        return type;
 }
@@ -151,26 +149,26 @@ gchar *wifi_eap_auth_type_to_string(wifi_eap_auth_type_e eap_auth_type)
 {
        gchar *type = NULL;
 
-       switch(eap_auth_type) {
-               case WIFI_EAP_AUTH_TYPE_PAP:
-                       type = g_strdup("PAP");
-                       break;
-               case WIFI_EAP_AUTH_TYPE_MSCHAP:
-                       type = g_strdup("MSCHAP");
-                       break;
-               case WIFI_EAP_AUTH_TYPE_MSCHAPV2:
-                       type = g_strdup("MSCHAPV2");
-                       break;
-               case WIFI_EAP_AUTH_TYPE_GTC:
-                       type = g_strdup("GTC");
-                       break;
-               case WIFI_EAP_AUTH_TYPE_MD5:
-                       type = g_strdup("MD5");
-                       break;
-               default:
-               case WIFI_EAP_AUTH_TYPE_NONE:
-                       type = NULL;
-                       break;
+       switch (eap_auth_type) {
+       case WIFI_EAP_AUTH_TYPE_PAP:
+               type = g_strdup("PAP");
+               break;
+       case WIFI_EAP_AUTH_TYPE_MSCHAP:
+               type = g_strdup("MSCHAP");
+               break;
+       case WIFI_EAP_AUTH_TYPE_MSCHAPV2:
+               type = g_strdup("MSCHAPV2");
+               break;
+       case WIFI_EAP_AUTH_TYPE_GTC:
+               type = g_strdup("GTC");
+               break;
+       case WIFI_EAP_AUTH_TYPE_MD5:
+               type = g_strdup("MD5");
+               break;
+       default:
+       case WIFI_EAP_AUTH_TYPE_NONE:
+               type = NULL;
+               break;
        }
        return type;
 }
@@ -179,23 +177,21 @@ wifi_eap_type_e wifi_eap_type_to_int(const gchar *type)
 {
        wifi_eap_type_e ret = -1;
 
-       if (type == NULL) {
+       if (type == NULL)
                return ret;
-       }
 
-       if (g_strcmp0(type, "PEAP") == 0) {
+       if (g_strcmp0(type, "PEAP") == 0)
                ret = WIFI_EAP_TYPE_PEAP;
-       } else if (g_strcmp0(type, "TLS") == 0) {
+       else if (g_strcmp0(type, "TLS") == 0)
                ret = WIFI_EAP_TYPE_TLS;
-       } else if (g_strcmp0(type, "TTLS") == 0) {
+       else if (g_strcmp0(type, "TTLS") == 0)
                ret = WIFI_EAP_TYPE_TTLS;
-       } else if (g_strcmp0(type, "SIM") == 0) {
+       else if (g_strcmp0(type, "SIM") == 0)
                ret = WIFI_EAP_TYPE_SIM;
-       } else if (g_strcmp0(type, "AKA") == 0) {
+       else if (g_strcmp0(type, "AKA") == 0)
                ret = WIFI_EAP_TYPE_AKA;
-       } else {
+       else
                WIFI_LOG(WIFI_ERROR, "Not supported type (%s)", type);
-       }
 
        return ret;
 }
@@ -204,23 +200,21 @@ wifi_eap_auth_type_e wifi_eap_auth_type_to_int(const gchar *type)
 {
        wifi_eap_auth_type_e ret = WIFI_EAP_AUTH_TYPE_NONE;
 
-       if (type == NULL) {
+       if (type == NULL)
                return ret;
-       }
 
-       if (g_strcmp0(type, "PAP") == 0) {
+       if (g_strcmp0(type, "PAP") == 0)
                ret = WIFI_EAP_AUTH_TYPE_PAP;
-       } else if (g_strcmp0(type, "MSCHAP") == 0) {
+       else if (g_strcmp0(type, "MSCHAP") == 0)
                ret = WIFI_EAP_AUTH_TYPE_MSCHAP;
-       } else if (g_strcmp0(type, "MSCHAPV2") == 0) {
+       else if (g_strcmp0(type, "MSCHAPV2") == 0)
                ret = WIFI_EAP_AUTH_TYPE_MSCHAPV2;
-       } else if (g_strcmp0(type, "GTC") == 0) {
+       else if (g_strcmp0(type, "GTC") == 0)
                ret = WIFI_EAP_AUTH_TYPE_GTC;
-       } else if (g_strcmp0(type, "MD5") == 0) {
+       else if (g_strcmp0(type, "MD5") == 0)
                ret = WIFI_EAP_AUTH_TYPE_MD5;
-       } else {
+       else
                WIFI_LOG(WIFI_ERROR, "Not supported type (%s)", type);
-       }
 
        return ret;
 }
@@ -229,21 +223,19 @@ static wifi_security_type_e _wifi_security_type_to_int(const gchar *type)
 {
        wifi_security_type_e ret = WIFI_SECURITY_TYPE_NONE;
 
-       if (type == NULL) {
+       if (type == NULL)
                return ret;
-       }
 
-       if (g_strcmp0(type, WIFI_SECURITY_NONE) == 0) {
+       if (g_strcmp0(type, WIFI_SECURITY_NONE) == 0)
                ret = WIFI_SECURITY_TYPE_NONE;
-       } else if (g_strcmp0(type, WIFI_SECURITY_WEP) == 0) {
+       else if (g_strcmp0(type, WIFI_SECURITY_WEP) == 0)
                ret = WIFI_SECURITY_TYPE_WEP;
-       } else if (g_strcmp0(type, WIFI_SECURITY_WPA_PSK) == 0) {
+       else if (g_strcmp0(type, WIFI_SECURITY_WPA_PSK) == 0)
                ret = WIFI_SECURITY_TYPE_WPA_PSK;
-       } else if (g_strcmp0(type, WIFI_SECURITY_EAP) == 0) {
+       else if (g_strcmp0(type, WIFI_SECURITY_EAP) == 0)
                ret = WIFI_SECURITY_TYPE_EAP;
-       } else {
+       else
                WIFI_LOG(WIFI_ERROR, "Not supported type (%s)", type);
-       }
 
        return ret;
 }
@@ -331,9 +323,8 @@ GSList *wifi_config_get_config_id_list(wifi_dbus *handle)
        }
 
        g_variant_get(result, "(as)", &iter);
-       while (g_variant_iter_loop(iter, "s", &config_id)) {
+       while (g_variant_iter_loop(iter, "s", &config_id))
                list = g_slist_append(list, g_strdup(config_id));
-       }
 
        g_variant_iter_free(iter);
        g_variant_unref(result);
@@ -440,18 +431,16 @@ int wifi_load_configurations(wifi_dbus *handle, const gchar *config_id, gchar **
                                        *security_type = _wifi_security_type_to_int(g_variant_get_string(value, NULL));
                                } else if (g_strcmp0(field, WIFI_CONFIG_HIDDEN) == 0) {
                                        const gchar *r_hidden = g_variant_get_string(value, NULL);
-                                       if (g_strcmp0(r_hidden, "TRUE") == 0) {
+                                       if (g_strcmp0(r_hidden, "TRUE") == 0)
                                                *is_hidden = TRUE;
-                                       } else {
+                                       else
                                                *is_hidden = FALSE;
-                                       }
                                } else if (g_strcmp0(field, WIFI_CONFIG_PROXYADDRESS) == 0) {
                                        const gchar *r_proxy_address = g_variant_get_string(value, NULL);
-                                       if (g_strcmp0(r_proxy_address, "NONE") == 0) {
+                                       if (g_strcmp0(r_proxy_address, "NONE") == 0)
                                                *proxy_address = NULL;
-                                       } else {
+                                       else
                                                *proxy_address = g_strdup(r_proxy_address);
-                                       }
                                } else if (g_strcmp0(field, WIFI_CONFIG_FAILURE) == 0) {
                                        *last_error = _wifi_last_error_to_enum(g_variant_get_string(value, NULL));
                                }
@@ -527,13 +516,12 @@ eap_save_config:
                        g_variant_builder_add(b, "{sv}", WIFI_CONFIG_EAP_SUBJECT_MATCH, g_variant_new_string(eap_config->subject_match));
 
                auth_type = wifi_eap_auth_type_to_string(eap_config->eap_auth_type);
-               if (auth_type != NULL) {
+               if (auth_type != NULL)
                        g_variant_builder_add(b, "{sv}", WIFI_CONFIG_EAP_AUTH_TYPE, g_variant_new_string(auth_type));
-               }
+
                eap_type = wifi_eap_type_to_string(eap_config->eap_type);
-               if (eap_type != NULL) {
+               if (eap_type != NULL)
                        g_variant_builder_add(b, "{sv}", WIFI_CONFIG_EAP_TYPE, g_variant_new_string(eap_type));
-               }
 
                g_free(auth_type);
                g_free(eap_type);
@@ -594,18 +582,16 @@ int wifi_load_eap_configurations(wifi_dbus *handle, const gchar *config_id, gcha
                                        *security_type = _wifi_security_type_to_int(g_variant_get_string(value, NULL));
                                } else if (g_strcmp0(field, WIFI_CONFIG_HIDDEN) == 0) {
                                        const gchar *r_hidden = g_variant_get_string(value, NULL);
-                                       if (g_strcmp0(r_hidden, "TRUE") == 0) {
+                                       if (g_strcmp0(r_hidden, "TRUE") == 0)
                                                *is_hidden = TRUE;
-                                       } else {
+                                       else
                                                *is_hidden = FALSE;
-                                       }
                                } else if (g_strcmp0(field, WIFI_CONFIG_PROXYADDRESS) == 0) {
                                        const gchar *r_proxy_address = g_variant_get_string(value, NULL);
-                                       if (g_strcmp0(r_proxy_address, "NONE") == 0) {
+                                       if (g_strcmp0(r_proxy_address, "NONE") == 0)
                                                *proxy_address = NULL;
-                                       } else {
+                                       else
                                                *proxy_address = g_strdup(r_proxy_address);
-                                       }
                                } else if (g_strcmp0(field, WIFI_CONFIG_EAP_ANONYMOUS_IDENTITY) == 0) {
                                        const gchar *anonymous_identity = g_variant_get_string(value, NULL);
                                        (*eap_config)->anonymous_identity = g_strdup(anonymous_identity);
old mode 100644 (file)
new mode 100755 (executable)
index 3f744a6..04a966a 100755 (executable)
@@ -91,7 +91,7 @@ static void __test_bg_scan_completed_callback(wifi_error_e error_code, void* use
 
 static void __test_scan_request_callback(wifi_error_e error_code, void* user_data)
 {
-       if(user_data != NULL)
+       if (user_data != NULL)
                printf("user_data : %s\n", (char *)user_data);
 
        printf("Scan Completed from scan request, error code : %s\n",
@@ -466,13 +466,13 @@ static bool __test_found_change_ip_method_callback(wifi_ap_h ap, void *user_data
                        return false;
                }
 
-              rv = test_get_user_int("Input Address type to get"
-                              "(0:IPV4, 1:IPV6):", &address_type);
+               rv = test_get_user_int("Input Address type to get"
+                                                       "(0:IPV4, 1:IPV6):", &address_type);
 
-              if (rv == false || (address_type != 0 && address_type != 1)) {
-                      printf("Invalid input!!\n");
-                      return false;
-              }
+               if (rv == false || (address_type != 0 && address_type != 1)) {
+                       printf("Invalid input!!\n");
+                       return false;
+               }
 
                switch (method) {
                case 1:
@@ -588,13 +588,13 @@ static bool __test_found_change_proxy_method_callback(wifi_ap_h ap, void *user_d
                        return false;
                }
 
-              rv = test_get_user_int("Input Address type to get"
-                              "(0:IPV4, 1:IPV6):", &address_type);
+               rv = test_get_user_int("Input Address type to get"
+                                                       "(0:IPV4, 1:IPV6):", &address_type);
 
-              if (rv == false || (address_type != 0 && address_type != 1)) {
-                      printf("Invalid input!!\n");
-                      return false;
-              }
+               if (rv == false || (address_type != 0 && address_type != 1)) {
+                       printf("Invalid input!!\n");
+                       return false;
+               }
 
                switch (method) {
                case 1:
@@ -704,12 +704,12 @@ static bool __test_found_print_ap_info_callback(wifi_ap_h ap, void *user_data)
                        printf("Fail to get Connection State\n");
 
                rv = test_get_user_int("Input Address type to get"
-                              "(0:IPV4, 1:IPV6):", &address_type);
+                                                       "(0:IPV4, 1:IPV6):", &address_type);
 
-           if (rv == false || (address_type != 0 && address_type != 1)) {
-               printf("Invalid input!!\n");
-               return false;
-           }
+               if (rv == false || (address_type != 0 && address_type != 1)) {
+                       printf("Invalid input!!\n");
+                       return false;
+               }
 
                if (wifi_ap_get_ip_config_type(ap, address_type, &ip_type) == WIFI_ERROR_NONE)
                        printf("IP config type : %d\n", ip_type);
@@ -876,10 +876,10 @@ static bool __test_found_specific_aps_callback(wifi_ap_h ap, void *user_data)
                return false;
        }
 
-       switch(security_type) {
-       case WIFI_SECURITY_TYPE_WEP :
-       case WIFI_SECURITY_TYPE_WPA_PSK :
-       case WIFI_SECURITY_TYPE_WPA2_PSK :
+       switch (security_type) {
+       case WIFI_SECURITY_TYPE_WEP:
+       case WIFI_SECURITY_TYPE_WPA_PSK:
+       case WIFI_SECURITY_TYPE_WPA2_PSK:
                {
                        char passphrase[100];
                        printf("Input passphrase for %s : ", ap_name);
@@ -893,7 +893,7 @@ static bool __test_found_specific_aps_callback(wifi_ap_h ap, void *user_data)
                        }
                }
                break;
-       case WIFI_SECURITY_TYPE_EAP :
+       case WIFI_SECURITY_TYPE_EAP:
                {
                        char input_str1[100];
                        printf("Input user name for %s : ", ap_name);
@@ -923,8 +923,8 @@ static bool __test_found_specific_aps_callback(wifi_ap_h ap, void *user_data)
                        g_free(inputed_name);
                }
                break;
-       case WIFI_SECURITY_TYPE_NONE :
-       default :
+       case WIFI_SECURITY_TYPE_NONE:
+       default:
                break;
        }
 
@@ -979,7 +979,7 @@ int  test_wifi_deinit(void)
 
        rv = wifi_deinitialize();
 
-       if (rv != WIFI_ERROR_NONE){
+       if (rv != WIFI_ERROR_NONE) {
                printf("Wifi deinit failed [%s]\n", __test_convert_error_to_string(rv));
                return -1;
        }
@@ -1532,14 +1532,14 @@ int main(int argc, char **argv)
 {
        GMainLoop *mainloop;
        g_type_init();
-       mainloop = g_main_loop_new (NULL, FALSE);
+       mainloop = g_main_loop_new(NULL, FALSE);
 
        GIOChannel *channel = g_io_channel_unix_new(0);
        g_io_add_watch(channel, (G_IO_IN|G_IO_ERR|G_IO_HUP|G_IO_NVAL), test_thread, NULL);
 
        printf("Test Thread created...\n");
 
-       g_main_loop_run (mainloop);
+       g_main_loop_run(mainloop);
 
        return 0;
 }
@@ -1565,31 +1565,31 @@ gboolean test_thread(GIOChannel *source, GIOCondition condition, gpointer data)
        if (a[0] == '\n' || a[0] == '\r') {
                printf("\n\n Network Connection API Test App\n\n");
                printf("Options..\n");
-               printf("1       - Wi-Fi init and set callbacks\n");
-               printf("2       - Wi-Fi deinit(unset callbacks automatically)\n");
-               printf("3       - Activate Wi-Fi device\n");
-               printf("4       - Deactivate Wi-Fi device\n");
-               printf("5       - Is Wi-Fi activated?\n");
-               printf("6       - Get connection state\n");
-               printf("7       - Get MAC address\n");
-               printf("8       - Get Wi-Fi interface name\n");
-               printf("9       - Scan request\n");
-               printf("a       - Get Connected AP\n");
-               printf("b       - Get AP list\n");
-               printf("c       - Connect\n");
-               printf("d       - Disconnect\n");
-               printf("e       - Connect by wps pbc\n");
-               printf("f       - Forget an AP\n");
-               printf("g       - Set & connect EAP\n");
-               printf("h       - Set IP method type\n");
-               printf("i       - Set Proxy method type\n");
-               printf("j       - Get Ap info\n");
-               printf("k       - Connect Specific AP\n");
-               printf("l       - Load configuration\n");
-               printf("m       - Save configuration\n");
-               printf("n       - Set configuration proxy and hidden\n");
-               printf("o       - Set EAP configuration\n");
-               printf("0       - Exit \n");
+               printf("1   - Wi-Fi init and set callbacks\n");
+               printf("2   - Wi-Fi deinit(unset callbacks automatically)\n");
+               printf("3   - Activate Wi-Fi device\n");
+               printf("4   - Deactivate Wi-Fi device\n");
+               printf("5   - Is Wi-Fi activated?\n");
+               printf("6   - Get connection state\n");
+               printf("7   - Get MAC address\n");
+               printf("8   - Get Wi-Fi interface name\n");
+               printf("9   - Scan request\n");
+               printf("a   - Get Connected AP\n");
+               printf("b   - Get AP list\n");
+               printf("c   - Connect\n");
+               printf("d   - Disconnect\n");
+               printf("e   - Connect by wps pbc\n");
+               printf("f   - Forget an AP\n");
+               printf("g   - Set & connect EAP\n");
+               printf("h   - Set IP method type\n");
+               printf("i   - Set Proxy method type\n");
+               printf("j   - Get Ap info\n");
+               printf("k   - Connect Specific AP\n");
+               printf("l   - Load configuration\n");
+               printf("m   - Save configuration\n");
+               printf("n   - Set configuration proxy and hidden\n");
+               printf("o   - Set EAP configuration\n");
+               printf("0   - Exit \n");
 
                printf("ENTER  - Show options menu.......\n");
        }