Apply Tizen coding rules 07/64407/1 accepted/tizen/common/20160406.144728 accepted/tizen/ivi/20160406.104842 accepted/tizen/mobile/20160406.104748 accepted/tizen/tv/20160406.104806 accepted/tizen/wearable/20160406.104820 submit/tizen/20160406.070613
authorYu Jiung <jiung.yu@samsung.com>
Fri, 1 Apr 2016 04:34:53 +0000 (13:34 +0900)
committerYu Jiung <jiung.yu@samsung.com>
Fri, 1 Apr 2016 04:34:56 +0000 (13:34 +0900)
Change-Id: I4cf1df84725683f911f770a377b24bfca7f046f1
Signed-off-by: Yu jiung <jiung.yu@samsung.com>
include/wifi-direct-internal.h
include/wifi-direct.h
packaging/capi-network-wifi-direct.spec
src/include/wifi-direct-client-proxy.h
src/include/wifi-direct-dbus.h
src/include/wifi-direct-ipc.h
src/wifi-direct-client-proxy.c
src/wifi-direct-dbus.c

index 17483a1..048b8f7 100644 (file)
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 
-
 #ifndef __WIFI_DIRECT_INTERNAL_H__
 #define __WIFI_DIRECT_INTERNAL_H__
 
@@ -29,7 +28,6 @@
 extern "C" {
 #endif
 
-
 /**
  * @brief Rejects the connection request from other device now in progress.
  * @since_tizen 2.3
@@ -73,6 +71,4 @@ int wifi_direct_accept_connection(char *mac_address);
 #ifdef __cplusplus
 }
 #endif
-
-
-#endif /* __WIFI_DIRECT_INTERNAL_H_*/
+#endif                                                 /* __WIFI_DIRECT_INTERNAL_H_ */
index 3060c70..f0ad657 100755 (executable)
@@ -27,7 +27,6 @@
 extern "C" {
 #endif
 
-
 /**
  * @addtogroup CAPI_NETWORK_WIFI_DIRECT_MODULE
  * @{
@@ -37,8 +36,7 @@ extern "C" {
  * @brief Enumeration for Wi-Fi Direct error code.
  * @since_tizen 2.3
  */
-typedef enum
-{
+typedef enum {
        WIFI_DIRECT_ERROR_NONE = TIZEN_ERROR_NONE,  /**< Successful */
        WIFI_DIRECT_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED,  /**< Operation not permitted(1) */
        WIFI_DIRECT_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,  /**< Out of memory(12) */
@@ -272,8 +270,7 @@ typedef enum {
  * @since_tizen 2.3
  * @remarks You can use APIs for wifi-direct display function instead of is_miracast_device value which is deprecated since 2.4.
  */
-typedef struct
-{
+typedef struct {
        char *device_name;  /**< Device's friendly name */
        char *mac_address;  /**< Device's P2P Device Address */
        char *interface_address;  /**< Device's P2P Interface Address, Valid only if device is a P2P GO */
@@ -298,8 +295,7 @@ typedef struct
  * @since_tizen 2.3
  * @remarks You can use APIs for wifi-direct display function instead of is_miracast_device value which is deprecated since 2.4.
  */
-typedef struct
-{
+typedef struct {
        char* device_name;  /**< Device's friendly name */
        char* ip_address;  /**< The IP address */
        char* mac_address;  /**< Device's P2P Device Address */
@@ -1840,7 +1836,7 @@ int wifi_direct_cancel_service_discovery(char *mac_address,
  * @param[in] info2  Describes the information of service. It is specific \n
  *     service.
  * @param[out] service_id  A Service ID will be assigned to service getting \n
- *     registered.
+ * registered.
  * @retval #WIFI_DIRECT_ERROR_NONE  Successful
  * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval #WIFI_DIRECT_ERROR_NOT_SUPPORTED  Not supported
@@ -1862,7 +1858,7 @@ int wifi_direct_register_service(wifi_direct_service_type_e service_type,
  * @privlevel public
  * @privilege http://tizen.org/privilege/wifidirect
  * @param[in] service_id  A Service ID for which service has to be \n
- *     deregistered.
+ * deregistered.
  * @retval #WIFI_DIRECT_ERROR_NONE  Successful
  * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval #WIFI_DIRECT_ERROR_NOT_SUPPORTED  Not supported
@@ -2131,6 +2127,4 @@ int wifi_direct_get_peer_display_throughput(char *mac_address, int *throughput);
 #ifdef __cplusplus
 }
 #endif
-
-#endif /* __TIZEN_NET_WIFI_DIRECT_H__ */
-
+#endif                                                 /* __TIZEN_NET_WIFI_DIRECT_H__ */
index 753d053..72a39eb 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-network-wifi-direct
 Summary:    Network WiFi-Direct Library
-Version:    1.2.57
+Version:    1.2.58
 Release:    1
 Group:      Network & Connectivity/API
 License:    Apache-2.0
index b5dccfc..764359b 100755 (executable)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Sungsik Jang <sungsik.jang@samsung.com>, Dongwook Lee <dwmax.lee@samsung.com> 
+ * Contact: Sungsik Jang <sungsik.jang@samsung.com>, Dongwook Lee <dwmax.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #define IPSTR_LEN 16
 #define WFD_SOCK_FILE_PATH "/tmp/wfd_client_socket"
 
-#define WIFIDIRECT_FEATURE                                             "http://tizen.org/feature/network.wifi.direct"
-#define WIFIDIRECT_DISPLAY_FEATURE                             "http://tizen.org/feature/network.wifi.direct.display"
-#define WIFIDIRECT_SERVICE_DISCOVERY_FEATURE   "http://tizen.org/feature/network.wifi.direct.service_discovery"
+#define WIFIDIRECT_FEATURE                                             "http://tizen.org/feature/network.wifi.direct"
+#define WIFIDIRECT_DISPLAY_FEATURE                             "http://tizen.org/feature/network.wifi.direct.display"
+#define WIFIDIRECT_SERVICE_DISCOVERY_FEATURE   "http://tizen.org/feature/network.wifi.direct.service_discovery"
 
 #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){\
+               if (!system_info_get_platform_bool(feature_name, &feature_supported)) {\
+                       if (feature_supported == FALSE) {\
                                LOGE("%s feature is disabled", feature_name);\
                                return WIFI_DIRECT_ERROR_NOT_SUPPORTED;\
-                       }\
+                       } \
                } else {\
                        LOGE("Error - Feature getting from System Info");\
                        return WIFI_DIRECT_ERROR_OPERATION_FAILED;\
-               }\
-       }while(0)
+               } \
+       } while (0)
 
-typedef struct
-{
+typedef struct {
        bool is_registered;
        int client_id;
        int sync_sockfd;
@@ -82,7 +81,7 @@ typedef struct
 
 extern char *wfd_debug_print(char *file, int line, char *format, ...);
 
-//Manage
+/* Manage */
 void wifi_direct_process_manage_activation(GDBusConnection *connection,
                const gchar *object_path, GVariant *parameters);
 void wifi_direct_process_manage_deactivation(GDBusConnection *connection,
@@ -104,13 +103,13 @@ void wifi_direct_process_manage_peer_found(GDBusConnection *connection,
 void wifi_direct_process_manage_peer_lost(GDBusConnection *connection,
                const gchar *object_path, GVariant *parameters);
 
-//Group
+/* Group */
 void wifi_direct_process_group_created(GDBusConnection *connection,
                const gchar *object_path, GVariant *parameters);
 void wifi_direct_process_group_destroyed(GDBusConnection *connection,
                const gchar *object_path, GVariant *parameters);
 
-//Service
+/* Service */
 void wifi_direct_process_service_discovery_started(GDBusConnection *connection,
                const gchar *object_path, GVariant *parameters);
 void wifi_direct_process_service_discovery_found(GDBusConnection *connection,
index 43be2f9..3e88bde 100644 (file)
@@ -45,7 +45,7 @@ extern "C" {
 #define WIFI_DIRECT_DBUS_REPLY_TIMEOUT_SYNC     10 * 1000
 #define DBUS_OBJECT_PATH_MAX                    150
 
-#define WFD_MANAGER_QUARK (g_quark_from_string ("wifi-direct-manager"))
+#define WFD_MANAGER_QUARK (g_quark_from_string("wifi-direct-manager"))
 
 #define wifi_direct_dbus_method_call_sync(interface_name, method, params, error) \
        wifi_direct_dbus_method_call_sync_debug(interface_name, method, params, error, __func__)
index 4e83e23..fdcbce1 100755 (executable)
@@ -67,148 +67,11 @@ typedef unsigned int ipv4_addr_t;
 #define VCONFKEY_SUBNET_MASK "memory/private/wifi_direct_manager/p2p_subnet_mask"
 #define VCONFKEY_GATEWAY "memory/private/wifi_direct_manager/p2p_gateway"
 
-typedef enum
-{
-       WIFI_DIRECT_CMD_INVALID,
-       WIFI_DIRECT_CMD_REGISTER,
-       WIFI_DIRECT_CMD_INIT_ASYNC_SOCKET,
-       WIFI_DIRECT_CMD_DEREGISTER,
-       WIFI_DIRECT_CMD_GET_LINK_STATUS,
-       WIFI_DIRECT_CMD_ACTIVATE,
-       WIFI_DIRECT_CMD_DEACTIVATE,
-       WIFI_DIRECT_CMD_START_DISCOVERY,
-       WIFI_DIRECT_CMD_START_DISCOVERY_SPECIFIC_CHANNEL,
-       WIFI_DIRECT_CMD_CANCEL_DISCOVERY,
-       WIFI_DIRECT_CMD_IS_LISTENING_ONLY,      // 10
-       WIFI_DIRECT_CMD_GET_DISCOVERY_RESULT,
-
-       WIFI_DIRECT_CMD_CONNECT,
-       WIFI_DIRECT_CMD_SEND_CONNECT_REQ,
-       WIFI_DIRECT_CMD_CANCEL_CONNECT, // deprecated
-       WIFI_DIRECT_CMD_CANCEL_CONNECTION,
-       WIFI_DIRECT_CMD_REJECT_CONNECTION,
-       WIFI_DIRECT_CMD_DISCONNECT,
-       WIFI_DIRECT_CMD_DISCONNECT_ALL,
-       WIFI_DIRECT_CMD_GET_CONNECTED_PEERS_INFO,
-
-       WIFI_DIRECT_CMD_CREATE_GROUP,   // 20
-       WIFI_DIRECT_CMD_DESTROY_GROUP,
-       WIFI_DIRECT_CMD_IS_GROUPOWNER,
-       WIFI_DIRECT_CMD_IS_AUTONOMOUS_GROUP,
-
-       WIFI_DIRECT_CMD_GET_SSID,
-       WIFI_DIRECT_CMD_SET_SSID,
-       WIFI_DIRECT_CMD_GET_IP_ADDR,
-       WIFI_DIRECT_CMD_GET_MAC_ADDR,
-       WIFI_DIRECT_CMD_GET_CONFIG,
-       WIFI_DIRECT_CMD_SET_CONFIG,
-
-       WIFI_DIRECT_CMD_ACTIVATE_PUSHBUTTON,    // 30
-       WIFI_DIRECT_CMD_SET_WPS_PIN,
-       WIFI_DIRECT_CMD_GET_WPS_PIN,
-       WIFI_DIRECT_CMD_GENERATE_WPS_PIN,
-       WIFI_DIRECT_CMD_SET_WPA,
-       WIFI_DIRECT_CMD_GET_SUPPORTED_WPS_MODE,
-       WIFI_DIRECT_CMD_GET_LOCAL_WPS_MODE,
-       WIFI_DIRECT_CMD_GET_REQ_WPS_MODE,
-       WIFI_DIRECT_CMD_SET_REQ_WPS_MODE,
-
-       WIFI_DIRECT_CMD_SET_GO_INTENT,
-       WIFI_DIRECT_CMD_GET_GO_INTENT,  // 40
-       WIFI_DIRECT_CMD_SET_MAX_CLIENT,
-       WIFI_DIRECT_CMD_GET_MAX_CLIENT,
-       WIFI_DIRECT_CMD_SET_AUTOCONNECTION_MODE,
-       WIFI_DIRECT_CMD_IS_AUTOCONNECTION_MODE,
-       WIFI_DIRECT_CMD_IS_DISCOVERABLE,
-
-       WIFI_DIRECT_CMD_GET_OPERATING_CHANNEL,
-       WIFI_DIRECT_CMD_ACTIVATE_PERSISTENT_GROUP,
-       WIFI_DIRECT_CMD_DEACTIVATE_PERSISTENT_GROUP,
-       WIFI_DIRECT_CMD_IS_PERSISTENT_GROUP_ACTIVATED,
-       WIFI_DIRECT_CMD_GET_PERSISTENT_GROUP_INFO,      // 50
-       WIFI_DIRECT_CMD_REMOVE_PERSISTENT_GROUP,
-       WIFI_DIRECT_CMD_GET_DEVICE_NAME,
-       WIFI_DIRECT_CMD_SET_DEVICE_NAME,
-
-       WIFI_DIRECT_CMD_SET_OEM_LOGLEVEL,
-       WIFI_DIRECT_CMD_GET_PEER_INFO,
-       WIFI_DIRECT_CMD_SET_PASSPHRASE,
-       WIFI_DIRECT_CMD_GET_PASSPHRASE,
-       WIFI_DIRECT_CMD_SET_AUTOCONNECTION_PEER,
-
-#ifdef TIZEN_FEATURE_SERVICE_DISCOVERY
-       WIFI_DIRECT_CMD_REGISTER_LOCAL_SERVICE,
-       WIFI_DIRECT_CMD_DEREGISTER_LOCAL_SERVICE,
-       WIFI_DIRECT_CMD_START_SERVICE_DISCOVERY,
-       WIFI_DIRECT_CMD_CANCEL_SERVICE_DISCOVERY,       //60
-
-       WIFI_DIRECT_CMD_REGISTER_SERVICE,
-       WIFI_DIRECT_CMD_DEREGISTER_SERVICE,
-#endif /* TIZEN_FEATURE_SERVICE_DISCOVERY */
-
-#ifdef TIZEN_FEATURE_WIFI_DISPLAY
-       WIFI_DIRECT_CMD_INIT_MIRACAST,
-       WIFI_DIRECT_CMD_INIT_DISPLAY,
-       WIFI_DIRECT_CMD_DEINIT_DISPLAY,
-       WIFI_DIRECT_CMD_SET_DISPLAY,
-       WIFI_DIRECT_CMD_SET_DISPLAY_AVAILABILITY,
-       WIFI_DIRECT_CMD_GET_PEER_DISPLAY_TYPE,
-       WIFI_DIRECT_CMD_GET_PEER_DISPLAY_AVAILABILITY,
-       WIFI_DIRECT_CMD_GET_PEER_DISPLAY_HDCP,
-       WIFI_DIRECT_CMD_GET_PEER_DISPLAY_PORT,
-       WIFI_DIRECT_CMD_GET_PEER_DISPLAY_THROUGHPUT,
-#endif /* TIZEN_FEATURE_WIFI_DISPLAY */
-
-
-
-       WIFI_DIRECT_CMD_MAX
-} wifi_direct_cmd_e;
-
-/**
- * Wi-Fi Direct client event for IPC
- */
-typedef enum
-{
-       WIFI_DIRECT_CLI_EVENT_INVALID = -1,                                     /**< */
-
-       WIFI_DIRECT_CLI_EVENT_ACTIVATION,                                               /**< */
-       WIFI_DIRECT_CLI_EVENT_DEACTIVATION,                                     /**< */
-
-       WIFI_DIRECT_CLI_EVENT_DISCOVER_START,                           /**< 80211 scan*/
-       WIFI_DIRECT_CLI_EVENT_DISCOVER_START_LISTEN_ONLY,       /**< listen only mode*/
-       WIFI_DIRECT_CLI_EVENT_DISCOVER_START_SEARCH_LISTEN,     /**< search, listen*/
-       WIFI_DIRECT_CLI_EVENT_DISCOVER_END,                                     /**< */
-       WIFI_DIRECT_CLI_EVENT_DISCOVER_FOUND_PEERS,                     /**< */
-       WIFI_DIRECT_CLI_EVENT_DISCOVER_LOST_PEERS,                      /**< */
-
-       WIFI_DIRECT_CLI_EVENT_CONNECTION_START,                         /**< */
-       WIFI_DIRECT_CLI_EVENT_CONNECTION_REQ,                           /**< */
-       WIFI_DIRECT_CLI_EVENT_CONNECTION_RSP,                           /**< */
-       WIFI_DIRECT_CLI_EVENT_CONNECTION_WPS_REQ,                       /**< */
-
-       WIFI_DIRECT_CLI_EVENT_DISCONNECTION_RSP,                                /**< */
-       WIFI_DIRECT_CLI_EVENT_DISCONNECTION_IND,                                /**< */
-       WIFI_DIRECT_CLI_EVENT_DISASSOCIATION_IND,                               /**< */
-
-       WIFI_DIRECT_CLI_EVENT_GROUP_CREATE_RSP,                         /**< */
-       WIFI_DIRECT_CLI_EVENT_GROUP_DESTROY_RSP,                                /**< */
-
-       WIFI_DIRECT_CLI_EVENT_IP_LEASED_IND,                            /**< */
-
-#ifdef TIZEN_FEATURE_SERVICE_DISCOVERY
-       WIFI_DIRECT_CLI_EVENT_SERVICE_DISCOVERY_STARTED,
-       WIFI_DIRECT_CLI_EVENT_SERVICE_DISCOVERY_FOUND,
-       WIFI_DIRECT_CLI_EVENT_SERVICE_DISCOVERY_FINISHED,
-#endif /* TIZEN_FEATURE_SERVICE_DISCOVERY */
-
-       WIFI_DIRECT_CLI_EVENT_MAX,
-} wfd_client_event_e;
 
 /**
  * Wi-Fi Direct configuration data structure for IPC
  */
-typedef struct
-{
+typedef struct {
        char device_name[WIFI_DIRECT_MAX_DEVICE_NAME_LEN + 1];
        int channel;
        wifi_direct_wps_type_e wps_config;
@@ -226,8 +89,7 @@ typedef struct
 /**
  * Wi-Fi Direct buffer structure to store result of peer discovery for IPC
  */
-typedef struct
-{
+typedef struct {
        char device_name[WIFI_DIRECT_MAX_DEVICE_NAME_LEN + 1];
        unsigned char mac_address[6];
        unsigned char intf_address[6];
@@ -251,8 +113,7 @@ typedef struct
 /**
  * Wi-Fi Direct buffer structure to store information of connected peer
  */
-typedef struct
-{
+typedef struct {
        char device_name[WIFI_DIRECT_MAX_DEVICE_NAME_LEN + 1];
        unsigned char ip_address[4];
        unsigned char mac_address[6];
@@ -268,49 +129,11 @@ typedef struct
 
 } wfd_connected_peer_info_s;
 
-typedef struct
-{
+
+typedef struct {
        int network_id;
        char ssid[WIFI_DIRECT_MAX_SSID_LEN + 1];
        unsigned char go_mac_address[6];
 } wfd_persistent_group_info_s;
 
-typedef struct
-{
-       int int1;
-       int int2;
-       int int3;
-       unsigned char mac_addr[6];
-} wifi_direct_client_request_data_s;
-
-
-typedef struct
-{
-       wifi_direct_cmd_e cmd;
-       int client_id;
-       unsigned int cmd_data_len;
-       wifi_direct_client_request_data_s data;
-} wifi_direct_client_request_s;
-
-typedef struct
-{
-       wifi_direct_cmd_e cmd;
-       wifi_direct_error_e result;
-       int client_id;
-       int param1;
-       char param2[64];
-       char param3[32];
-       int data_length;
-} wifi_direct_client_response_s;
-
-typedef struct
-{
-       wfd_client_event_e event;
-       wifi_direct_error_e error;
-       int type;
-       char param1[64];
-       char param2[256];
-} wifi_direct_client_noti_s;
-
-
 #endif /* __WIFI_DIRECT_IPC_H__ */
index f997acb..51ebd1f 100755 (executable)
@@ -103,7 +103,7 @@ static wifi_direct_client_info_s *__wfd_get_control()
 static int __net_wifidirect_gerror_to_enum(GError* error)
 {
        int ret = WIFI_DIRECT_ERROR_NONE;
-       if(error == NULL) {
+       if (error == NULL) {
                WDC_LOGI("GError is NULL!!");
                return ret;
        }
@@ -294,7 +294,7 @@ void wifi_direct_process_manage_peer_ip_assigned(GDBusConnection *connection,
                return;
        }
 
-       g_variant_get(reply, "(i&s)", ret ,&get_str);
+       g_variant_get(reply, "(i&s)", ret&get_str);
        g_variant_unref(reply);
 
        WDC_LOGD("Interface Name = [%s]", get_str);
@@ -561,8 +561,7 @@ void __wfd_client_print_entry_list(wfd_discovery_entry_s *list, int num)
        int i = 0;
 
        WDC_LOGD("------------------------------------------");
-       for (i = 0; i < num; i++)
-       {
+       for (i = 0; i < num; i++)       {
                WDC_LOGD("== Peer index : %d ==", i);
                WDC_LOGD("is Group Owner ? %s", list[i].is_group_owner ? "YES" : "NO");
                WDC_LOGD("device_name : %s", list[i].device_name);
@@ -644,9 +643,8 @@ int wifi_direct_initialize(void)
                                                  "GetState", NULL, &error);
 
        res = __net_wifidirect_gerror_to_enum(error);
-       if(res != WIFI_DIRECT_ERROR_NONE) {
+       if (res != WIFI_DIRECT_ERROR_NONE)
                return res;
-       }
 
        g_variant_get(reply, "(ii)", &res, &state);
        WDC_LOGD("State = [%d]", state);
@@ -669,7 +667,7 @@ int wifi_direct_initialize(void)
 
 #ifdef TIZEN_FEATURE_SERVICE_DISCOVERY
        g_client_info.service_cb = NULL;
-       g_client_info.user_data_for_cb_service= NULL;
+       g_client_info.user_data_for_cb_service = NULL;
 #endif /* TIZEN_FEATURE_SERVICE_DISCOVERY */
 
        __WDC_LOG_FUNC_END__;
@@ -1022,7 +1020,7 @@ int wifi_direct_activate(void)
                                                    "Activate", NULL, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1051,7 +1049,7 @@ int wifi_direct_deactivate(void)
                                                  "Deactivate", NULL, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1084,7 +1082,7 @@ int wifi_direct_start_discovery(bool listen_only, int timeout)
                return WIFI_DIRECT_ERROR_INVALID_PARAMETER;
        }
 
-       builder = g_variant_builder_new(G_VARIANT_TYPE ("a{sv}"));
+       builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
        g_variant_builder_add(builder, "{sv}", "Mode", g_variant_new("b", listen_only));
        g_variant_builder_add(builder, "{sv}", "Timeout", g_variant_new("i", timeout));
        params = g_variant_new("(a{sv})", builder);
@@ -1095,7 +1093,7 @@ int wifi_direct_start_discovery(bool listen_only, int timeout)
                                                  "StartDiscovery", params, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1130,7 +1128,7 @@ int wifi_direct_start_discovery_specific_channel(bool listen_only,
                return WIFI_DIRECT_ERROR_INVALID_PARAMETER;
        }
 
-       builder = g_variant_builder_new(G_VARIANT_TYPE ("a{sv}"));
+       builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
        g_variant_builder_add(builder, "{sv}", "Mode", g_variant_new("b", listen_only));
        g_variant_builder_add(builder, "{sv}", "Timeout", g_variant_new("i", timeout));
        g_variant_builder_add(builder, "{sv}", "Channel", g_variant_new("i", channel));
@@ -1142,7 +1140,7 @@ int wifi_direct_start_discovery_specific_channel(bool listen_only,
                                                  "StartDiscovery", params, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1171,7 +1169,7 @@ int wifi_direct_cancel_discovery(void)
                                                  "StopDiscovery", NULL, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1202,10 +1200,10 @@ static char **get_service_list(char *services, unsigned int *count)
        pos1 = services;
        pos2 = g_strdup(services);
 
-       pos1 = strtok_r (pos1,",\n", &saveptr);
+       pos1 = strtok_r(pos1, ",\n", &saveptr);
        while (pos1) {
                cnt++;
-               pos1 = strtok_r (NULL, ",\n", &saveptr);
+               pos1 = strtok_r(NULL, ",\n", &saveptr);
        }
        WDC_LOGD("Total Service Count = %d", cnt);
 
@@ -1216,13 +1214,13 @@ static char **get_service_list(char *services, unsigned int *count)
                        g_free(pos2);
                        return NULL;
                }
-               pos2 = strtok_r (pos2,",\n", &saveptr);
+               pos2 = strtok_r(pos2, ",\n", &saveptr);
                while (pos2 != NULL) {
                        char *s = strchr(pos2, ' ');
                        if (s) {
                                *s = '\0';
                                result[i++] = strdup(pos2);
-                               pos2 = strtok_r (NULL, ",\n", &saveptr);
+                               pos2 = strtok_r(NULL, ",\n", &saveptr);
                        }
                }
        }
@@ -1236,7 +1234,7 @@ static char **get_service_list(char *services, unsigned int *count)
        } else {
                *count = 0;
                if (result) {
-                       for (j=0; j<i && result[j] != NULL; j++)
+                       for (j = 0; j < i && result[j] != NULL; j++)
                                free(result[j]);
                        free(result);
                }
@@ -1277,9 +1275,8 @@ int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb cb,
                                                  "GetDiscoveredPeers", params, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret!= WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(iaa{sv})", &ret, &iter_peers);
        if (ret != WIFI_DIRECT_ERROR_NONE) {
@@ -1289,7 +1286,7 @@ int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb cb,
 
        WDC_LOGD("wifi_direct_foreach_discovered_peers() SUCCESS");
 //LCOV_EXCL_START
-       while(g_variant_iter_loop(iter_peers, "a{sv}", &iter_peer)) {
+       while (g_variant_iter_loop(iter_peers, "a{sv}", &iter_peer)) {
                wifi_direct_discovered_peer_info_s *peer_list = NULL;
 
                peer_list = (wifi_direct_discovered_peer_info_s *) g_try_malloc0(sizeof(wifi_direct_discovered_peer_info_s));
@@ -1348,7 +1345,7 @@ int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb cb,
                        }
                }
 
-               //__wfd_client_print_entry_list(peer_list, 1);
+               /* __wfd_client_print_entry_list(peer_list, 1); */
                if (!cb(peer_list, user_data)) {
                        g_variant_iter_free(iter_peer);
                        break;
@@ -1389,7 +1386,7 @@ int wifi_direct_connect(char *mac_address)
                                                  "Connect", params, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1428,7 +1425,7 @@ int wifi_direct_cancel_connection(char *mac_address)
                                                  "CancelConnection", params, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1467,7 +1464,7 @@ int wifi_direct_reject_connection(char *mac_address)
                                                  "RejectConnection", params, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1498,7 +1495,7 @@ int wifi_direct_disconnect_all(void)
                                                  "DisconnectAll", NULL, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1537,7 +1534,7 @@ int wifi_direct_disconnect(char *mac_address)
                                                  "Disconnect", params, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1575,7 +1572,7 @@ int wifi_direct_accept_connection(char *mac_address)
                                                  "AcceptConnection", params, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1619,9 +1616,8 @@ int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb cb,
                                                  "GetConnectedPeers", params, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(iaa{sv})", &ret, &iter_peers);
        if (ret != WIFI_DIRECT_ERROR_NONE) {
@@ -1631,7 +1627,7 @@ int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb cb,
 
        WDC_LOGD("wifi_direct_foreach_connected_peers() SUCCESS");
 
-       while(g_variant_iter_loop(iter_peers, "a{sv}", &iter_peer)) {
+       while (g_variant_iter_loop(iter_peers, "a{sv}", &iter_peer)) {
                wifi_direct_connected_peer_info_s *peer_list = NULL;
 
                peer_list = (wifi_direct_connected_peer_info_s *) g_try_malloc0(sizeof(wifi_direct_connected_peer_info_s));
@@ -1692,7 +1688,7 @@ int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb cb,
                        }
                }
 
-               //__wfd_client_print_connected_peer_info(peer_list, 1);
+               /* __wfd_client_print_connected_peer_info(peer_list, 1); */
                if (!cb(peer_list, user_data)) {
                        g_variant_iter_free(iter_peer);
                        break;
@@ -1727,7 +1723,7 @@ int wifi_direct_create_group(void)
                                                  "CreateGroup", NULL, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1758,7 +1754,7 @@ int wifi_direct_destroy_group(void)
                                                  "DestroyGroup", NULL, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1798,9 +1794,8 @@ int wifi_direct_is_group_owner(bool *owner)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        WDC_LOGD("%s() SUCCESS", __func__);
        g_variant_get(reply, "(b)", &val);
@@ -1840,9 +1835,8 @@ int wifi_direct_is_autonomous_group(bool *autonomous_group)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        WDC_LOGD("%s() SUCCESS", __func__);
        g_variant_get(reply, "(b)", &val);
@@ -1884,7 +1878,7 @@ int wifi_direct_set_group_owner_intent(int intent)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -1923,9 +1917,8 @@ int wifi_direct_get_group_owner_intent(int *intent)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &val);
        *intent = val;
@@ -1962,7 +1955,7 @@ int wifi_direct_set_max_clients(int max)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -2001,9 +1994,8 @@ int wifi_direct_get_max_clients(int *max)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &val);
        *max = val;
@@ -2044,9 +2036,8 @@ int wifi_direct_get_operating_channel(int *channel)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &val);
        *channel = val;
@@ -2080,7 +2071,7 @@ int wifi_direct_activate_pushbutton(void)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -2121,7 +2112,7 @@ int wifi_direct_set_wps_pin(char *pin)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -2161,12 +2152,11 @@ int wifi_direct_get_wps_pin(char **pin)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(i&s)", &ret, &str);
-       if(pin != NULL && str != NULL)
+       if (pin != NULL && str != NULL)
                *pin = g_strdup(str);
        g_variant_unref(reply);
 
@@ -2204,9 +2194,8 @@ int wifi_direct_get_supported_wps_mode(int *wps_mode)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &mode);
        *wps_mode = mode;
@@ -2247,9 +2236,8 @@ int wifi_direct_foreach_supported_wps_types(wifi_direct_supported_wps_type_cb cb
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &wps_mode);
        g_variant_unref(reply);
@@ -2295,9 +2283,8 @@ int wifi_direct_get_local_wps_type(wifi_direct_wps_type_e *type)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &mode);
        *type = mode;
@@ -2342,7 +2329,7 @@ int wifi_direct_set_req_wps_type(wifi_direct_wps_type_e type)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -2381,9 +2368,8 @@ int wifi_direct_get_req_wps_type(wifi_direct_wps_type_e *type)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &mode);
        *type = mode;
@@ -2423,9 +2409,8 @@ int wifi_direct_get_ssid(char **ssid)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(i&s)", &ret, &str);
        *ssid = g_strdup(str);
@@ -2465,9 +2450,8 @@ int wifi_direct_get_device_name(char **device_name)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(i&s)", &ret, &str);
        *device_name = g_strdup(str);
@@ -2509,7 +2493,7 @@ int wifi_direct_set_device_name(const char *device_name)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -2559,11 +2543,10 @@ int wifi_direct_get_network_interface_name(char **name)
                                                  &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
-       g_variant_get(reply, "(i&s)", ret ,&get_str);
+       g_variant_get(reply, "(i&s)", ret&get_str);
        *name = g_strdup(get_str);
        g_variant_unref(reply);
 
@@ -2603,11 +2586,10 @@ int wifi_direct_get_ip_address(char **ip_address)
                                                  &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
-       g_variant_get(reply, "(i&s)", ret ,&str);
+       g_variant_get(reply, "(i&s)", ret&str);
        *ip_address = g_strdup(str);
        g_variant_unref(reply);
 
@@ -2643,7 +2625,7 @@ int wifi_direct_get_subnet_mask(char **subnet_mask)
 
        ret = wifi_direct_get_state(&status);
        WDC_LOGD("wifi_direct_get_state() state=[%d], ret=[%d]", status, ret);
-       ifstatus < WIFI_DIRECT_STATE_CONNECTED) {
+       if (status < WIFI_DIRECT_STATE_CONNECTED) {
                WDC_LOGE("Device is not connected!");
                __WDC_LOG_FUNC_END__;
                return WIFI_DIRECT_ERROR_NOT_PERMITTED;
@@ -2655,11 +2637,10 @@ int wifi_direct_get_subnet_mask(char **subnet_mask)
                                                  &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
-       g_variant_get(reply, "(i&s)", ret ,&get_str);
+       g_variant_get(reply, "(i&s)", ret&get_str);
        *subnet_mask = g_strdup(get_str);
        g_variant_unref(reply);
 
@@ -2696,7 +2677,7 @@ int wifi_direct_get_gateway_address(char **gateway_address)
 
        ret = wifi_direct_get_state(&status);
        WDC_LOGD("wifi_direct_get_state() state=[%d], ret=[%d]", status, ret);
-       if(status < WIFI_DIRECT_STATE_CONNECTED) {
+       if (status < WIFI_DIRECT_STATE_CONNECTED) {
                WDC_LOGE("Device is not connected!");
                __WDC_LOG_FUNC_END__;
                return WIFI_DIRECT_ERROR_NOT_PERMITTED;
@@ -2708,11 +2689,10 @@ int wifi_direct_get_gateway_address(char **gateway_address)
                                                  &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
-       g_variant_get(reply, "(i&s)", ret ,&get_str);
+       g_variant_get(reply, "(i&s)", ret&get_str);
        *gateway_address = g_strdup(get_str);
        g_variant_unref(reply);
 
@@ -2753,9 +2733,8 @@ int wifi_direct_get_mac_address(char **mac_address)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(i&s)", &ret, &str);
        *mac_address = g_strdup(str);
@@ -2795,14 +2774,13 @@ int wifi_direct_get_state(wifi_direct_state_e *state)
                                                  "GetState", NULL, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &val);
        *state = (wifi_direct_state_e) val;
        /* for CAPI : there is no WIFI_DIRECT_STATE_GROUP_OWNER type in CAPI */
-       if(*state == WIFI_DIRECT_STATE_GROUP_OWNER)
+       if (*state == WIFI_DIRECT_STATE_GROUP_OWNER)
                *state = WIFI_DIRECT_STATE_CONNECTED;
 
        g_variant_unref(reply);
@@ -2840,12 +2818,11 @@ int wifi_direct_is_discoverable(bool* discoverable)
                                                  "IsDiscoverable", NULL, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(b)", discoverable);
-       WDC_LOGD("Discoverable = [%s]", *discoverable ? "Yes":"No");
+       WDC_LOGD("Discoverable = [%s]", *discoverable ? "Yes" : "No");
 
        WDC_LOGD("%s() SUCCESS", __func__);
        g_variant_unref(reply);
@@ -2880,13 +2857,12 @@ int wifi_direct_is_listening_only(bool* listen_only)
                                                  "IsListeningOnly", NULL, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(b)", listen_only);
 
-       WDC_LOGD("Is listen only = [%s]", *listen_only ? "Yes":"No");
+       WDC_LOGD("Is listen only = [%s]", *listen_only ? "Yes" : "No");
        WDC_LOGD("%s() SUCCESS", __func__);
        g_variant_unref(reply);
 
@@ -2979,7 +2955,7 @@ int wifi_direct_set_autoconnection_mode(bool mode)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -3018,9 +2994,8 @@ int wifi_direct_is_autoconnection_mode(bool *mode)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ib)", &ret, &val);
        *mode = val;
@@ -3056,7 +3031,7 @@ int wifi_direct_set_persistent_group_enabled(bool enabled)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -3097,9 +3072,8 @@ int wifi_direct_is_persistent_group_enabled(bool *enabled)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        WDC_LOGD("%s() SUCCESS", __func__);
        g_variant_get(reply, "(b)", &val);
@@ -3142,9 +3116,8 @@ int wifi_direct_foreach_persistent_groups(wifi_direct_persistent_group_cb cb,
                                                  "GetPersistentGroups", params, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(iaa{sv})", &ret, &iter_groups);
        if (ret != WIFI_DIRECT_ERROR_NONE) {
@@ -3154,7 +3127,7 @@ int wifi_direct_foreach_persistent_groups(wifi_direct_persistent_group_cb cb,
 
        WDC_LOGD("wifi_direct_foreach_persistent_groups() SUCCESS");
 //LCOV_EXCL_START
-       while(g_variant_iter_loop(iter_groups, "a{sv}", &iter_group)) {
+       while (g_variant_iter_loop(iter_groups, "a{sv}", &iter_group)) {
                const char *ssid = NULL;
                char *go_mac_address = NULL;
 
@@ -3220,7 +3193,7 @@ int wifi_direct_remove_persistent_group(char *mac_address, const char *ssid)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -3273,7 +3246,7 @@ int wifi_direct_start_service_discovery(char *mac_address,
                                                    &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -3327,7 +3300,7 @@ int wifi_direct_cancel_service_discovery(char *mac_address,
                                                    &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -3443,7 +3416,7 @@ int wifi_direct_deregister_service(unsigned int service_id)
                                                    &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -3462,7 +3435,7 @@ int wifi_direct_init_miracast(bool enable)
        __WDC_LOG_FUNC_START__;
        int ret = WIFI_DIRECT_ERROR_NONE;
 
-       if(enable)
+       if (enable)
                ret = wifi_direct_init_display();
        else
                ret = wifi_direct_deinit_display();
@@ -3508,9 +3481,8 @@ int wifi_direct_get_peer_info(char* mac_address, wifi_direct_discovered_peer_inf
                                                  "GetPeerInfo", params, &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ia{sv})", &ret, &iter_peer);
        if (ret != WIFI_DIRECT_ERROR_NONE) {
@@ -3646,7 +3618,7 @@ int wifi_direct_get_passphrase(char** passphrase)
                return WIFI_DIRECT_ERROR_NOT_INITIALIZED;
        }
 
-       if(!passphrase){
+       if (!passphrase) {
                WDC_LOGE("NULL Param [passphrase]!");
                __WDC_LOG_FUNC_END__;
                return WIFI_DIRECT_ERROR_INVALID_PARAMETER;
@@ -3658,9 +3630,8 @@ int wifi_direct_get_passphrase(char** passphrase)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        WDC_LOGD("%s() SUCCESS", __func__);
        g_variant_get(reply, "(i&s)", &ret, &val);
@@ -3702,7 +3673,7 @@ int wifi_direct_set_autoconnection_peer(char *mac_address)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -3735,7 +3706,7 @@ int wifi_direct_init_display(void)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -3771,7 +3742,7 @@ int wifi_direct_deinit_display(void)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -3817,7 +3788,7 @@ int wifi_direct_set_display(wifi_direct_display_type_e type, int port, int hdcp)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -3856,7 +3827,7 @@ int wifi_direct_set_display_availability(bool availability)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret == WIFI_DIRECT_ERROR_NONE) {
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                g_variant_get(reply, "(i)", &ret);
                g_variant_unref(reply);
        }
@@ -3902,9 +3873,8 @@ int wifi_direct_get_peer_display_type(char *mac_address, wifi_direct_display_typ
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &val);
        *type = val;
@@ -3950,9 +3920,8 @@ int wifi_direct_get_peer_display_availability(char *mac_address, bool *availabil
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &val);
        *availability = val;
@@ -3998,9 +3967,8 @@ int wifi_direct_get_peer_display_hdcp(char *mac_address, int *hdcp)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &val);
        *hdcp = val;
@@ -4046,9 +4014,8 @@ int wifi_direct_get_peer_display_port(char *mac_address, int *port)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &val);
        *port = val;
@@ -4094,9 +4061,8 @@ int wifi_direct_get_peer_display_throughput(char *mac_address, int *throughput)
                                          &error);
 
        ret = __net_wifidirect_gerror_to_enum(error);
-       if(ret != WIFI_DIRECT_ERROR_NONE) {
+       if (ret != WIFI_DIRECT_ERROR_NONE)
                return ret;
-       }
 
        g_variant_get(reply, "(ii)", &ret, &val);
        *throughput = val;
index e22cc14..1a1c407 100644 (file)
@@ -184,7 +184,7 @@ gboolean wifi_direct_dbus_init(void)
        GDBusConnection *connection = NULL;
 
        connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &Error);
-       if(connection == NULL) {
+       if (connection == NULL) {
                WDC_LOGE("Failed to get connection, Error[%s]", Error->message);
                g_error_free(Error); //LCOV_EXCL_LINE
                return FALSE; //LCOV_EXCL_LINE
@@ -238,9 +238,9 @@ int wifi_direct_dbus_unpack_ay(unsigned char *dst, GVariant *src, int size)
                return -1;
        }
 
-       while (g_variant_iter_loop (iter, "y", &dst[length])) {
+       while (g_variant_iter_loop(iter, "y", &dst[length])) {
                length++;
-               if(length >= size)
+               if (length >= size)
                        break;
        }
        g_variant_iter_free(iter);