Fix the coding style errors (bt-service) 09/72909/1 accepted/tizen/common/20160607.194547 accepted/tizen/ivi/20160607.071930 accepted/tizen/mobile/20160607.071857 accepted/tizen/tv/20160607.071902 accepted/tizen/wearable/20160607.071846 submit/tizen/20160607.011620
authorDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 3 Jun 2016 04:19:38 +0000 (13:19 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 3 Jun 2016 04:19:38 +0000 (13:19 +0900)
Change-Id: I9b08cfa50b3d0f18674ded0f1a43692de82deadb
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
19 files changed:
bt-service/bt-request-handler.c
bt-service/bt-service-adapter-le.c
bt-service/bt-service-adapter.c
bt-service/bt-service-audio.c
bt-service/bt-service-avrcp-controller.c
bt-service/bt-service-common.c
bt-service/bt-service-dpm.c
bt-service/bt-service-event-receiver.c
bt-service/bt-service-gap-agent.c
bt-service/bt-service-headset-connection.c
bt-service/bt-service-hid.c
bt-service/bt-service-main.c
bt-service/bt-service-network.c
bt-service/bt-service-obex-agent.c
bt-service/bt-service-obex-server.c
bt-service/bt-service-oob.c
bt-service/bt-service-opp-client.c
bt-service/bt-service-pbap.c
bt-service/include/bt-service-common.h

index 6890ceb..0deefbf 100644 (file)
@@ -1978,7 +1978,7 @@ int __bt_obexd_request(int function_name,
                                                  "org.freedesktop.DBus",
                                                  NULL, &error_connection);
 
-               if(process_proxy == NULL)
+               if (process_proxy == NULL)
                        BT_DBG("Fail to get process_proxy");
 
                if (error_connection) {
index 3787c27..3c9f549 100755 (executable)
@@ -147,7 +147,7 @@ static void __bt_send_foreach_event(gpointer data, gpointer user_data)
        char *sender = data;
        GVariant *param = user_data;
 
-       _bt_send_event_to_dest(sender, BT_DEVICE_EVENT,BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
+       _bt_send_event_to_dest(sender, BT_DEVICE_EVENT, BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
                                        param);
 }
 #endif
@@ -190,7 +190,7 @@ void _bt_service_adapter_le_deinit(void)
 
 gboolean _bt_update_le_feature_support(const char *item, const char *value)
 {
-       if (item== NULL || value == NULL)
+       if (item == NULL || value == NULL)
                return FALSE;
 
        if (g_strcmp0(item, "adv_inst_max") == 0) {
@@ -458,7 +458,7 @@ int _bt_set_custom_advertising(const char *sender, int adv_handle,
        adv_params.interval_min = params->interval_min;
        adv_params.interval_max = params->interval_max;
        adv_params.filter_policy = params->filter_policy;
-       adv_params.type= params->type;
+       adv_params.type = params->type;
 
        if (ret)
                g_variant_unref(ret);
@@ -1337,7 +1337,7 @@ int _bt_start_le_scan(const char *sender)
        }
 
        ret = g_dbus_proxy_call_sync(proxy, "StartLEDiscovery",
-                               NULL,G_DBUS_CALL_FLAGS_NONE,
+                               NULL, G_DBUS_CALL_FLAGS_NONE,
                                -1, NULL, &error);
 
        if (error) {
@@ -1417,7 +1417,7 @@ int _bt_stop_le_scan(const char *sender)
        }
 
        ret = g_dbus_proxy_call_sync(proxy, "StopLEDiscovery",
-                               NULL,G_DBUS_CALL_FLAGS_NONE,
+                               NULL, G_DBUS_CALL_FLAGS_NONE,
                                -1, NULL, &error);
        if (ret == NULL) {
                BT_ERR("LE Scan stop failed");
@@ -1925,7 +1925,7 @@ int _bt_clear_white_list(void)
        retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        ret = g_dbus_proxy_call_sync(proxy, "ClearDeviceWhiteList",
-                               NULL,G_DBUS_CALL_FLAGS_NONE,
+                               NULL, G_DBUS_CALL_FLAGS_NONE,
                                -1, NULL, &error);
 
        if (error) {
@@ -1957,7 +1957,7 @@ int _bt_initialize_ipsp(void)
        retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        ret = g_dbus_proxy_call_sync(proxy, "InitializeIpsp",
-                               NULL,G_DBUS_CALL_FLAGS_NONE,
+                               NULL, G_DBUS_CALL_FLAGS_NONE,
                                -1, NULL, &error);
        if (error) {
                BT_ERR("Initialize IPSP Failed :[%s]", error->message);
@@ -1988,7 +1988,7 @@ int _bt_deinitialize_ipsp(void)
        retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        ret = g_dbus_proxy_call_sync(proxy, "DeinitializeIpsp",
-                               NULL,G_DBUS_CALL_FLAGS_NONE,
+                               NULL, G_DBUS_CALL_FLAGS_NONE,
                                -1, NULL, &error);
        if (error) {
                BT_ERR("De-Initialize IPSP Failed :[%s]", error->message);
@@ -2030,7 +2030,7 @@ int _bt_le_read_maximum_data_length(
                return BLUETOOTH_ERROR_INTERNAL;
        }
 
-       g_variant_get(reply ,"(qqqq)", &max_tx_octets, &max_tx_time,
+       g_variant_get(reply"(qqqq)", &max_tx_octets, &max_tx_time,
                                &max_rx_octets, &max_rx_time);
 
        max_le_datalength->max_tx_octets = max_tx_octets;
@@ -2101,7 +2101,7 @@ int _bt_le_read_host_suggested_default_data_length(
                return BLUETOOTH_ERROR_INTERNAL;
        }
 
-       g_variant_get(reply ,"(qq)", &def_tx_octets, &def_tx_time);
+       g_variant_get(reply"(qq)", &def_tx_octets, &def_tx_time);
 
        def_data_length->def_tx_octets = def_tx_octets;
        def_data_length->def_tx_time = def_tx_time;
index 184c746..5ea51cb 100644 (file)
@@ -189,7 +189,7 @@ static void __bt_visibility_alarm_create()
 
        result = alarmmgr_add_alarm(ALARM_TYPE_VOLATILE, visible_timer.timeout,
                                                0, NULL, &alarm_id);
-       if(result < 0) {
+       if (result < 0) {
                BT_ERR("Failed to create alarm error = %d\n", result);
        } else {
                BT_DBG("Alarm created = %d\n", alarm_id);
@@ -346,9 +346,9 @@ static int __bt_get_bonded_device_info(gchar *device_path,
        g_variant_get(result, "(a{sv})", &property_iter);
 
        while (g_variant_iter_loop(property_iter, "{sv}", &key, &value)) {
-               if (!g_strcmp0(key,"Paired")) {
+               if (!g_strcmp0(key, "Paired")) {
                        paired = g_variant_get_boolean(value);
-               } else if(!g_strcmp0(key, "Address")) {
+               } else if (!g_strcmp0(key, "Address")) {
                        address = g_variant_get_string(value, NULL);
                } else if (!g_strcmp0(key, "Alias")) {
                        name = g_variant_get_string(value, NULL);
@@ -370,9 +370,10 @@ static int __bt_get_bonded_device_info(gchar *device_path,
                } else if (!g_strcmp0(key, "ManufacturerData")) {
                        manufacturer_data = g_byte_array_new();
                        g_variant_get(value, "ay", &char_value_iter);
-                       while(g_variant_iter_loop(char_value_iter, "y",  &char_value)) {
+
+                       while (g_variant_iter_loop(char_value_iter, "y",  &char_value))
                                g_byte_array_append(manufacturer_data, &char_value, 1);
-                       }
+
                        g_variant_iter_free(char_value_iter);
 
                        if (manufacturer_data) {
@@ -548,7 +549,7 @@ static int __bt_set_enabled(void)
 #else
 #ifdef TIZEN_TV
        if (_bt_set_discoverable_mode(
-               BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE, 0)!= BLUETOOTH_ERROR_NONE)
+               BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE, 0) != BLUETOOTH_ERROR_NONE)
                        BT_ERR("Fail to set discoverable mode");
 #endif
 #endif
@@ -593,7 +594,7 @@ void _bt_set_disabled(int result)
                BT_DBG("Update vconf for BT normal Deactivation");
 
                if (result == BLUETOOTH_ERROR_TIMEOUT)
-                       if (vconf_set_int(BT_OFF_DUE_TO_TIMEOUT, 1) != 0 )
+                       if (vconf_set_int(BT_OFF_DUE_TO_TIMEOUT, 1) != 0)
                                BT_ERR("Set vconf failed");
 
                /* Update Bluetooth Status to notify other modules */
@@ -1792,8 +1793,8 @@ int _bt_is_service_used(char *service_uuid, gboolean *used)
 
        g_variant_get(result, "(v)", &value);
        g_variant_get(value, "as", &iter);
-       if(iter == NULL) {
-               BT_ERR("Failed to get UUIDs(%s)",service_uuid);
+       if (iter == NULL) {
+               BT_ERR("Failed to get UUIDs(%s)", service_uuid);
                *used = FALSE;
                g_variant_unref(result);
                g_variant_unref(value);
@@ -2305,11 +2306,11 @@ static bluetooth_device_info_t *__bt_parse_device_info(GVariantIter *item_iter)
                        address = g_variant_get_string(value, NULL);
                        _bt_convert_addr_string_to_type(dev_info->device_address.addr,
                                                        address);
-               } else if(!g_strcmp0(key, "Class")) {
+               } else if (!g_strcmp0(key, "Class")) {
                        unsigned int cod;
                        cod = g_variant_get_uint32(value);
                        _bt_divide_device_class(&dev_info->device_class, cod);
-               } else if(!g_strcmp0(key, "Name")) {
+               } else if (!g_strcmp0(key, "Name")) {
                        const char *name = NULL;
                        name = g_variant_get_string(value, NULL);
                        /* If there is no Alias */
@@ -2317,7 +2318,7 @@ static bluetooth_device_info_t *__bt_parse_device_info(GVariantIter *item_iter)
                                g_strlcpy(dev_info->device_name.name, name,
                                                BLUETOOTH_DEVICE_NAME_LENGTH_MAX+1);
                        }
-               } else if(!g_strcmp0(key, "Alias")) {
+               } else if (!g_strcmp0(key, "Alias")) {
                        const char *alias = NULL;
                        alias = g_variant_get_string(value, NULL);
                        /* Overwrite the name */
@@ -2364,9 +2365,10 @@ static bluetooth_device_info_t *__bt_parse_device_info(GVariantIter *item_iter)
                } else if (strcasecmp(key, "ManufacturerData") == 0) {
                        manufacturer_data = g_byte_array_new();
                        g_variant_get(value, "ay", &char_value_iter);
-                       while(g_variant_iter_loop(char_value_iter, "y",  &char_value)) {
+
+                       while (g_variant_iter_loop(char_value_iter, "y",  &char_value))
                                g_byte_array_append(manufacturer_data, &char_value, 1);
-                       }
+
                        if (manufacturer_data) {
                                if (manufacturer_data->len > 0) {
                                        memcpy(dev_info->manufacturer_data.data, manufacturer_data->data, manufacturer_data->len);
index 31949eb..9d4eca6 100755 (executable)
@@ -544,19 +544,21 @@ static gboolean __bt_device_support_uuid(char *remote_address,
                                bt_audio_type_t type)
 {
        GArray *dev_list = NULL;
-       int size,i,j;
+       int size;
+       int i;
+       int j;
        bluetooth_device_info_t info;
        char bond_address[BT_ADDRESS_STRING_SIZE] = { 0 };
        gboolean ret = FALSE;
 
        BT_DBG("+");
 
-       dev_list = g_array_new (FALSE, FALSE, sizeof(gchar));
+       dev_list = g_array_new(FALSE, FALSE, sizeof(gchar));
 
        _bt_get_bonded_devices(&dev_list);
        size = (dev_list->len) / sizeof(bluetooth_device_info_t);
 
-       for (i=0; i < size; i++) {
+       for (i = 0; i < size; i++) {
                info = g_array_index(dev_list, bluetooth_device_info_t, i);
                _bt_convert_addr_type_to_string(bond_address,
                                info.device_address.addr);
index 40a4962..dc4f3d5 100755 (executable)
@@ -379,7 +379,7 @@ int _bt_avrcp_control_get_property(int type, unsigned int *value)
                        case SHUFFLE:
                        case SCAN:
                        case STATUS:
-                               name =(char *)g_variant_get_string(reply, NULL);
+                               name = (char *)g_variant_get_string(reply, NULL);
                                *value = __bt_media_attrval_to_val(type, name);
                                BT_DBG("Type[%s] and Value[%s]", __bt_media_type_to_str(type), name);
                                break;
@@ -463,21 +463,21 @@ static int __bt_avrcp_control_parse_properties(
        const char *key = NULL;
 
        g_variant_iter_init(&iter, item);
-       while (g_variant_iter_loop(&iter, "{sv}", &key, &value)){
-               if (strcasecmp(key, "Title") == 0){
+       while (g_variant_iter_loop(&iter, "{sv}", &key, &value)) {
+               if (strcasecmp(key, "Title") == 0) {
                        value_string = (char *)g_variant_get_string(value, NULL);
                        BT_DBG("Value : %s ", value_string);
                        metadata->title = value_string;
                } else if (strcasecmp(key, "Artist") == 0) {
-                       value_string =(char *)g_variant_get_string(value, NULL);
+                       value_string = (char *)g_variant_get_string(value, NULL);
                        BT_DBG("Value : %s ", value_string);
                        metadata->artist = value_string;
                } else if (strcasecmp(key, "Album") == 0) {
-                       value_string =(char *)g_variant_get_string(value, NULL);
+                       value_string = (char *)g_variant_get_string(value, NULL);
                        BT_DBG("Value : %s ", value_string);
                        metadata->album = value_string;
                } else if (strcasecmp(key, "Genre") == 0) {
-                       value_string =(char *)g_variant_get_string(value, NULL);
+                       value_string = (char *)g_variant_get_string(value, NULL);
                        BT_DBG("Value : %s ", value_string);
                        metadata->genre = value_string;
                } else if (strcasecmp(key, "Duration") == 0) {
@@ -590,7 +590,7 @@ void _bt_handle_avrcp_control_event(GVariant *reply, const char *path)
                        (strcasecmp(property, "Repeat") == 0) ||
                        (strcasecmp(property, "Shuffle") == 0) ||
                        (strcasecmp(property, "Scan") == 0) ||
-                       (strcasecmp(property, "Status") == 0)){
+                       (strcasecmp(property, "Status") == 0)) {
                                const char *valstr;
                                unsigned int type, val;
 
@@ -621,7 +621,7 @@ void _bt_handle_avrcp_control_event(GVariant *reply, const char *path)
 
                        ret = __bt_avrcp_control_parse_properties(
                                                                &metadata, reply);
-                       if (BLUETOOTH_ERROR_NONE != ret){
+                       if (BLUETOOTH_ERROR_NONE != ret) {
                                /* Free key and value because of break unless free not required */
                                free((char *)property);
                                g_variant_unref(value);
index a9b9b49..4c82de9 100755 (executable)
@@ -73,7 +73,7 @@ GDBusConnection *_bt_gdbus_get_system_gconn(void)
 
        if (system_gconn == NULL) {
                system_gconn = _bt_gdbus_init_system_gconn();
-       } else if (g_dbus_connection_is_closed(system_gconn)){
+       } else if (g_dbus_connection_is_closed(system_gconn)) {
 
                local_system_gconn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
 
@@ -179,7 +179,7 @@ GDBusConnection *__bt_init_system_gconn(void)
 GDBusConnection *__bt_init_session_conn(void)
 {
        if (session_conn == NULL)
-               session_conn =g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL);
+               session_conn = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL);
 
        return session_conn;
 }
@@ -495,7 +495,7 @@ int _bt_copy_utf8_string(char *dest, const char *src, unsigned int length)
                while (count > 0 && ((i + count) < length)) {
                        dest[i++] = *p;
                        p++;
-                       count --;
+                       count--;
                }
                p = next;
        }
@@ -527,7 +527,7 @@ gboolean _bt_utf8_validate(char *name)
 int _bt_register_osp_server_in_agent(int type, char *uuid, char *path, int fd)
 {
        BT_DBG("+");
-       if (!_bt_agent_register_osp_server( type, uuid, path, fd))
+       if (!_bt_agent_register_osp_server(type, uuid, path, fd))
                return BLUETOOTH_ERROR_INTERNAL;
 
        return BLUETOOTH_ERROR_NONE;
@@ -536,7 +536,7 @@ int _bt_register_osp_server_in_agent(int type, char *uuid, char *path, int fd)
 int _bt_unregister_osp_server_in_agent(int type, char *uuid)
 {
        BT_DBG("+");
-       if (!_bt_agent_unregister_osp_server( type, uuid))
+       if (!_bt_agent_unregister_osp_server(type, uuid))
                return BLUETOOTH_ERROR_INTERNAL;
 
        return BLUETOOTH_ERROR_NONE;
@@ -637,7 +637,7 @@ char *_bt_get_device_object_path(char *address)
 
 char *_bt_get_profile_uuid128(bt_profile_type_t profile_type)
 {
-       switch(profile_type) {
+       switch (profile_type) {
        case BT_PROFILE_CONN_RFCOMM:
                return strdup(RFCOMM_UUID_STR);
        case BT_PROFILE_CONN_A2DP:
@@ -742,7 +742,7 @@ char *_bt_convert_error_to_string(int error)
 
 char * _bt_convert_disc_reason_to_string(int reason)
 {
-       switch(reason) {
+       switch (reason) {
        case 1:
                return "Link loss";
        case 2:
index 63c4891..47c4805 100644 (file)
 #include "bt-service-dpm.h"
 
 static dpm_policy_t policy_table[DPM_POLICY_END] = {
-       [DPM_POLICY_ALLOW_BLUETOOTH] = {{DPM_BT_ERROR}},
-       [DPM_POLICY_BLUETOOTH_DEVICE_RESTRICTION] = {{DPM_STATUS_ERROR}},
-       [DPM_POLICY_BLUETOOTH_UUID_RESTRICTION] = {{DPM_STATUS_ERROR}},
-       [DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST] = {{NULL}},
-       [DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST] = {{NULL}},
-       [DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST] = {{NULL}},
-       [DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST] = {{NULL}},
-       [DPM_POLICY_ALLOW_BLUETOOTH_OUTGOING_CALL] = {{DPM_STATUS_ERROR}},
-       [DPM_POLICY_BLUETOOTH_PAIRING_STATE] = {{DPM_STATUS_ERROR}},
-       [DPM_POLICY_BLUETOOTH_DESKTOP_CONNECTIVITY_STATE] = {{DPM_STATUS_ERROR}},
-       [DPM_POLICY_BLUETOOTH_DISCOVERABLE_STATE] = {{DPM_STATUS_ERROR}},
-       [DPM_POLICY_BLUETOOTH_LIMITED_DISCOVERABLE_STATE] = {{DPM_STATUS_ERROR}},
-       [DPM_POLICY_BLUETOOTH_DATA_TRANSFER_STATE] = {{DPM_STATUS_ERROR}},
+       [DPM_POLICY_ALLOW_BLUETOOTH] = { {DPM_BT_ERROR} },
+       [DPM_POLICY_BLUETOOTH_DEVICE_RESTRICTION] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_UUID_RESTRICTION] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST] = { {NULL} },
+       [DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST] = { {NULL} },
+       [DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST] = { {NULL} },
+       [DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST] = { {NULL} },
+       [DPM_POLICY_ALLOW_BLUETOOTH_OUTGOING_CALL] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_PAIRING_STATE] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_DESKTOP_CONNECTIVITY_STATE] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_DISCOVERABLE_STATE] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_LIMITED_DISCOVERABLE_STATE] = { {DPM_STATUS_ERROR} },
+       [DPM_POLICY_BLUETOOTH_DATA_TRANSFER_STATE] = { {DPM_STATUS_ERROR} },
 };
 
 
@@ -276,7 +276,7 @@ dpm_result_t _bt_dpm_add_bluetooth_uuids_to_blacklist(const char *uuid)
 dpm_result_t _bt_dpm_get_bluetooth_uuids_from_blacklist(GArray **out_param1)
 {
        dpm_result_t ret = DPM_RESULT_FAIL;
-       bt_dpm_uuids_list_t uuids_list = {0, {{0}, }};
+       bt_dpm_uuids_list_t uuids_list = {0, { {0}, } };
        GSList *list = policy_table[DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST].list;
        int i = 0;
 
@@ -322,7 +322,7 @@ dpm_result_t _bt_dpm_add_bluetooth_uuids_to_whitelist(const char *uuid)
 dpm_result_t _bt_dpm_get_bluetooth_uuids_from_whitelist(GArray **out_param1)
 {
        dpm_result_t ret = DPM_RESULT_FAIL;
-       bt_dpm_uuids_list_t uuids_list = {0, {{0}, }};
+       bt_dpm_uuids_list_t uuids_list = {0, { {0}, } };
        GSList *list = policy_table[DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST].list;
        int i = 0;
 
@@ -683,9 +683,8 @@ dpm_result_t _bt_dpm_clear_bluetooth_uuids_from_list(void)
                return DPM_RESULT_ACCESS_DENIED;
 
        err = _bt_dpm_clear_bluetooth_uuids_from_blacklist();
-       if (!err){
+       if (!err)
                err = _bt_dpm_clear_bluetooth_uuids_from_blacklist();
-       }
 
        return err;
 }
@@ -699,9 +698,8 @@ dpm_result_t _bt_dpm_clear_bluetooth_devices_from_list(void)
                return DPM_RESULT_ACCESS_DENIED;
 
        err = _bt_dpm_clear_bluetooth_devices_from_blacklist();
-       if (!err){
+       if (!err)
                err = _bt_dpm_clear_bluetooth_devices_from_blacklist();
-       }
 
        return err;
 }
index 5fae36f..81cba0d 100644 (file)
@@ -97,7 +97,7 @@ static bt_le_adv_info_t *__bt_get_adv_ind_info(char *addr)
        retv_if(!addr, NULL);
        bt_le_adv_info_t *adv_info = NULL;
        GList *current = g_list_first((GList *)p_adv_ind_list);
-       while(current && current->data) {
+       while (current && current->data) {
                adv_info = (bt_le_adv_info_t *)current->data;
                retv_if(adv_info && !g_strcmp0(adv_info->addr, addr), adv_info);
                current = g_list_next(current);
@@ -122,7 +122,7 @@ static void __bt_del_adv_ind_info(char *addr)
        ret_if(!p_adv_ind_list);
        bt_le_adv_info_t *adv_info = NULL;
        GList *current = g_list_first((GList *)p_adv_ind_list);
-       while(current && current->data) {
+       while (current && current->data) {
                adv_info = (bt_le_adv_info_t *)current->data;
                if (adv_info && !g_strcmp0(adv_info->addr, addr)) {
                        p_adv_ind_list = g_list_remove(p_adv_ind_list, adv_info);
@@ -172,7 +172,7 @@ static gboolean __bt_parse_device_properties(GVariant *item,
                } else if (strcasecmp(key, "UUIDs") == 0) {
                        char **uuid_value;
                        gsize size = 0;
-                       int i =0;
+                       int i = 0;
                        size = g_variant_get_size(val);
 
                        if (size > 0) {
@@ -222,14 +222,14 @@ static gboolean __bt_parse_interface(GVariant *msg,
        GVariant *optional_param;
        GVariantIter iter;
        GVariant *child;
-       char *interface_name= NULL;
+       char *interface_name = NULL;
        GVariant *inner_iter = NULL;
        g_variant_get(msg, "(&o@a{sa{sv}})",
                                        &path, &optional_param);
        g_variant_iter_init(&iter, optional_param);
 
        while ((child = g_variant_iter_next_value(&iter))) {
-               g_variant_get(child,"{&s@a{sv}}", &interface_name, &inner_iter);
+               g_variant_get(child, "{&s@a{sv}}", &interface_name, &inner_iter);
                if (g_strcmp0(interface_name, BT_DEVICE_INTERFACE) == 0) {
                        BT_DBG("Found a device: %s", path);
                        if (__bt_parse_device_properties(inner_iter,
@@ -342,7 +342,7 @@ void __bt_update_remote_cache_devinfo(const char *address, gboolean paired_statu
 
        node = g_list_first(p_cache_list);
 
-       while (node != NULL){
+       while (node != NULL) {
                cache_info = (bt_cache_info_t *)node->data;
 
                if (cache_info == NULL) {
@@ -374,10 +374,10 @@ static void __bt_device_remote_connected_properties(
        GVariant *param = NULL;
        BT_DBG("+");
 
-       if (remote_dev_info->uuid_count > 0 ) {
-               for (i = 0; i<remote_dev_info->uuid_count; i++) {
+       if (remote_dev_info->uuid_count > 0) {
+               for (i = 0; i < remote_dev_info->uuid_count; i++) {
                        char *uuid = remote_dev_info->uuids[i];
-                       if (strcasecmp(uuid, HID_UUID) == 0){
+                       if (strcasecmp(uuid, HID_UUID) == 0) {
                                int event = BLUETOOTH_EVENT_NONE;
 
                                event = (connected == TRUE) ?
@@ -443,7 +443,7 @@ void _bt_handle_adapter_event(GVariant *msg, const char *member)
 
                node = g_list_first(p_cache_list);
 
-               while (node != NULL){
+               while (node != NULL) {
                        cache_info = (bt_cache_info_t *)node->data;
 
                        if (cache_info == NULL) {
@@ -502,7 +502,7 @@ void _bt_handle_adapter_event(GVariant *msg, const char *member)
                gboolean status = FALSE;
                char *address = NULL;
                int link_type;
-               g_variant_get(msg,"(sib)", &address, &link_type, &status);
+               g_variant_get(msg, "(sib)", &address, &link_type, &status);
 
                BT_DBG("RSSI Enabled [%s %d]", address, status);
                param = g_variant_new("(isib)", result,
@@ -517,7 +517,7 @@ void _bt_handle_adapter_event(GVariant *msg, const char *member)
                int rssi_dbm;
                int link_type;
                char *address = NULL;
-               g_variant_get(msg,"(siii)", &address, &link_type, &alert_type, &rssi_dbm);
+               g_variant_get(msg, "(siii)", &address, &link_type, &alert_type, &rssi_dbm);
 
                BT_DBG("RSSI Alert: [Address %s LinkType %d] [Type %d DBM %d]",
                                address, alert_type, rssi_dbm);
@@ -532,7 +532,7 @@ void _bt_handle_adapter_event(GVariant *msg, const char *member)
                int rssi_dbm;
                int link_type;
                char *address = NULL;
-               g_variant_get(msg,"(sii)", &address, &link_type, &rssi_dbm);
+               g_variant_get(msg, "(sii)", &address, &link_type, &rssi_dbm);
 
                BT_DBG("Raw RSSI: [Address %s] [Link Type %d][RSSI DBM %d]",
                                address, link_type, rssi_dbm);
@@ -562,8 +562,8 @@ static void __bt_adapter_property_changed_event(GVariant *msg, const char *path)
        GError *err = NULL;
        char *property = NULL;
        GVariant *param = NULL;
-       g_variant_iter_init (&value_iter, msg);
-       while ((g_variant_iter_loop (&value_iter,"{sv}", &property, &val))) {
+       g_variant_iter_init(&value_iter, msg);
+       while ((g_variant_iter_loop(&value_iter, "{sv}", &property, &val))) {
                BT_INFO("Property %s", property);
 
                if (strcasecmp(property, "Discovering") == 0) {
@@ -719,7 +719,7 @@ static void __bt_adapter_property_changed_event(GVariant *msg, const char *path)
                        gboolean powered = FALSE;
                        int bt_state;
 
-                       g_variant_get(val, "b" ,&powered);
+                       g_variant_get(val, "b"&powered);
                        BT_DBG("Powered = %d", powered);
                        if (powered == FALSE) {
 #ifdef USB_BLUETOOTH
@@ -734,8 +734,7 @@ static void __bt_adapter_property_changed_event(GVariant *msg, const char *path)
                                        bt_state != VCONFKEY_BT_LE_STATUS_OFF) {
                                        _bt_set_le_disabled(BLUETOOTH_ERROR_NONE);
                                }
-                       }
-                       else {
+                       } else {
 #ifdef USB_BLUETOOTH
                                _bt_handle_adapter_added();
 #endif
@@ -791,8 +790,8 @@ static void __bt_obex_property_changed_event(GVariant *msg, const char *path)
        GVariantIter value_iter;
        GVariant *child = NULL, *val = NULL;
        char *property = NULL;
-       g_variant_iter_init (&value_iter, msg);
-       while ((child = g_variant_iter_next_value (&value_iter))) {
+       g_variant_iter_init(&value_iter, msg);
+       while ((child = g_variant_iter_next_value(&value_iter))) {
                g_variant_get(child, "{sv}", &property, &val);
 
                ret_if(property == NULL);
@@ -803,12 +802,12 @@ static void __bt_obex_property_changed_event(GVariant *msg, const char *path)
                        char  *status;
                        g_variant_get(val, "s", &status);
 
-                       if (strcasecmp(status, "active") == 0){
+                       if (strcasecmp(status, "active") == 0) {
                                _bt_obex_transfer_started(path);
                        } else if (strcasecmp(status, "complete") == 0) {
                                _bt_obex_transfer_completed(path, TRUE);
                                _bt_pbap_obex_transfer_completed(path, TRUE);
-                       } else if (strcasecmp(status, "error") == 0){
+                       } else if (strcasecmp(status, "error") == 0) {
                                _bt_obex_transfer_completed(path, FALSE);
                                _bt_pbap_obex_transfer_completed(path, FALSE);
                        }
@@ -817,7 +816,7 @@ static void __bt_obex_property_changed_event(GVariant *msg, const char *path)
                        static int transferred  = 0;
                        g_variant_get(val, "t", &transferred);
 
-                       _bt_obex_transfer_progress(path,transferred);
+                       _bt_obex_transfer_progress(path, transferred);
                }
                g_free(property);
                g_variant_unref(val);
@@ -838,7 +837,7 @@ static void __bt_device_property_changed_event(GVariant *msg, const char *path)
        char *address;
        GVariant *param = NULL;
        bt_remote_dev_info_t *remote_dev_info;
-       g_variant_iter_init (&value_iter, msg);
+       g_variant_iter_init(&value_iter, msg);
        while ((g_variant_iter_loop(&value_iter, "{sv}", &property, &val))) {
                BT_DBG("Property %s", property);
                if (strcasecmp(property, "Connected") == 0) {
@@ -913,7 +912,7 @@ static void __bt_device_property_changed_event(GVariant *msg, const char *path)
                                GVariantBuilder *builder = NULL;
                                int i = 0;
                                builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
-                               for (i=0; i < remote_dev_info->uuid_count; i++) {
+                               for (i = 0; i < remote_dev_info->uuid_count; i++) {
                                        g_variant_builder_add(builder, "s",
                                                remote_dev_info->uuids[i]);
                                }
@@ -990,7 +989,7 @@ static void __bt_device_property_changed_event(GVariant *msg, const char *path)
                                return;
                        }
 
-                       if(paired == FALSE) {
+                       if (paired == FALSE) {
                                BT_INFO("Unpaired: %s", address);
                                __bt_update_remote_cache_devinfo(address, FALSE);
                                param = g_variant_new("(is)", result, address);
@@ -1013,7 +1012,7 @@ static void __bt_device_property_changed_event(GVariant *msg, const char *path)
                                GVariantBuilder *builder = NULL;
                                int i = 0;
                                builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
-                               for (i=0; i < remote_dev_info->uuid_count; i++) {
+                               for (i = 0; i < remote_dev_info->uuid_count; i++) {
                                        g_variant_builder_add(builder, "s",
                                                remote_dev_info->uuids[i]);
                                }
@@ -1131,8 +1130,8 @@ static void __bt_media_control_changed_event(GVariant *msg, const char *path)
        GVariant *child = NULL;
        bt_remote_dev_info_t *remote_dev_info;
        GVariant *param = NULL;
-       g_variant_iter_init (&value_iter, msg);
-       while ((child = g_variant_iter_next_value (&value_iter))) {
+       g_variant_iter_init(&value_iter, msg);
+       while ((child = g_variant_iter_next_value(&value_iter))) {
                g_variant_get(child, "{sv}", &property, &val);
                BT_INFO("Property %s", property);
                if (strcasecmp(property, "Connected") == 0) {
@@ -1176,13 +1175,13 @@ void _bt_handle_property_changed_event(GVariant *msg, const char *object_path)
        char *interface_name = NULL;
        GVariant *val = NULL;
 
-       g_variant_get(msg, "(&s@a{sv}@as)", &interface_name, &val,NULL);
+       g_variant_get(msg, "(&s@a{sv}@as)", &interface_name, &val, NULL);
 
        if (strcasecmp(interface_name, BT_ADAPTER_INTERFACE) == 0) {
                __bt_adapter_property_changed_event(val,
                                        object_path);
        } else if (strcasecmp(interface_name, BT_DEVICE_INTERFACE) == 0) {
-               __bt_device_property_changed_event(val,object_path);
+               __bt_device_property_changed_event(val, object_path);
        } else if (strcasecmp(interface_name, BT_OBEX_TRANSFER_INTERFACE) == 0) {
                BT_DBG("BT_OBEX_TRANSFER_INTERFACE");
                __bt_obex_property_changed_event(val,
@@ -1212,8 +1211,8 @@ void __bt_opc_property_changed_event(GVariant *msg,
        GVariant *val = NULL;
        GVariant *child = NULL;
 
-       g_variant_iter_init (&value_iter, msg);
-       while ((child = g_variant_iter_next_value (&value_iter))) {
+       g_variant_iter_init(&value_iter, msg);
+       while ((child = g_variant_iter_next_value(&value_iter))) {
                g_variant_get(child, "{sv}", &property, &val);
                ret_if(property == NULL);
 
@@ -1222,11 +1221,11 @@ void __bt_opc_property_changed_event(GVariant *msg,
                        g_variant_get(val, "s", &status);
                        BT_DBG("Status is %s", status);
 
-                       if(strcasecmp(status, "active") == 0){
+                       if (strcasecmp(status, "active") == 0) {
                                _bt_obex_client_started(path);
-                       }else if (strcasecmp(status, "complete") == 0) {
+                       } else if (strcasecmp(status, "complete") == 0) {
                                _bt_obex_client_completed(path, TRUE);
-                       }else if (strcasecmp(status, "error") == 0){
+                       } else if (strcasecmp(status, "error") == 0) {
                                _bt_obex_client_completed(path, FALSE);
                        }
                        g_free(status);
@@ -1269,8 +1268,8 @@ void _bt_handle_input_event(GVariant *msg, const char *path)
        GVariant *child = NULL, *val = NULL;
        bt_remote_dev_info_t *remote_dev_info;
        GVariant *param = NULL;
-       g_variant_iter_init (&value_iter, msg);
-       while ((child = g_variant_iter_next_value (&value_iter))) {
+       g_variant_iter_init(&value_iter, msg);
+       while ((child = g_variant_iter_next_value(&value_iter))) {
                g_variant_get(child, "{sv}", &property, &val);
 
                ret_if(property == NULL);
@@ -1375,7 +1374,7 @@ void _bt_handle_network_client_event(GVariant *msg,
        GVariant *val = NULL;
        GVariantIter value_iter;
        GVariant *param = NULL;
-       g_variant_iter_init (&value_iter, msg);
+       g_variant_iter_init(&value_iter, msg);
        while ((g_variant_iter_loop(&value_iter, "{sv}", &property, &val))) {
                if (strcasecmp(property, "Connected") == 0) {
                        int event = BLUETOOTH_EVENT_NONE;
@@ -1418,7 +1417,7 @@ void __bt_gatt_char_property_changed_event(GVariant *msg,
        GVariant *val = NULL;
        int result = BLUETOOTH_ERROR_NONE;
        GVariant *param = NULL;
-       g_variant_iter_init (&value_iter, msg);
+       g_variant_iter_init(&value_iter, msg);
        char_handle = g_strdup(path);
        while ((g_variant_iter_loop(&value_iter, "{sv}", &property, &val))) {
                BT_INFO("Property %s", property);
@@ -1435,13 +1434,13 @@ void __bt_gatt_char_property_changed_event(GVariant *msg,
                } else if (strcasecmp(property, "ChangedValue") == 0) {
                        int len = 0;
                        GByteArray *gp_byte_array = NULL;
-                       BT_INFO("Type '%s'\n", g_variant_get_type_string (val));
+                       BT_INFO("Type '%s'\n", g_variant_get_type_string(val));
 
                        if (val) {
                                gp_byte_array = g_byte_array_new();
                                len = g_variant_get_size(val);
                                BT_DBG("Len = %d", len);
-                               g_byte_array_append (gp_byte_array,
+                               g_byte_array_append(gp_byte_array,
                                        (const guint8 *) g_variant_get_data(val), len);
                                if (gp_byte_array->len != 0) {
                                        GVariant *byte_array = NULL;
@@ -1565,7 +1564,7 @@ void _bt_handle_device_event(GVariant *msg, const char *member, const char *path
                        GVariantBuilder *builder = NULL;
                        int i = 0;
                        builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
-                       for (i=0; i < remote_dev_info->uuid_count; i++) {
+                       for (i = 0; i < remote_dev_info->uuid_count; i++) {
                                g_variant_builder_add(builder, "s",
                                        remote_dev_info->uuids[i]);
                        }
@@ -1619,7 +1618,7 @@ void _bt_handle_device_event(GVariant *msg, const char *member, const char *path
                                GVariantBuilder *builder = NULL;
                                int i = 0;
                                builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
-                               for (i=0; i < remote_dev_info->uuid_count; i++) {
+                               for (i = 0; i < remote_dev_info->uuid_count; i++) {
                                        g_variant_builder_add(builder, "s",
                                                remote_dev_info->uuids[i]);
                                }
@@ -1708,7 +1707,7 @@ void _bt_handle_device_event(GVariant *msg, const char *member, const char *path
                 */
                _bt_obex_check_pending_transfer(address);
                _bt_opp_client_is_sending(&sending);
-               if(sending == TRUE)
+               if (sending == TRUE)
                        _bt_opp_client_check_pending_transfer(address);
                param = g_variant_new("(isy)", result, address, addr_type);
                _bt_send_event(BT_DEVICE_EVENT,
@@ -2162,8 +2161,8 @@ void _bt_handle_sink_event(GVariant *msg, const char *path)
        GVariant *child = NULL;
        GVariant *val = NULL;
        GVariant *param = NULL;
-       g_variant_iter_init (&value_iter, msg);
-       while ((child = g_variant_iter_next_value (&value_iter))) {
+       g_variant_iter_init(&value_iter, msg);
+       while ((child = g_variant_iter_next_value(&value_iter))) {
 
                g_variant_get(child, "{sv}", &property, &val);
 
@@ -2220,7 +2219,7 @@ void _bt_handle_sink_event(GVariant *msg, const char *path)
                                                                wait_list->out_param1);
                                }
                                g_free(address);
-                       }else if (strcasecmp(value, "Connected") == 0) {
+                       } else if (strcasecmp(value, "Connected") == 0) {
                                char *address;
                                char connected_address[BT_ADDRESS_STRING_SIZE + 1];
                                bluetooth_device_address_t device_address;
@@ -2317,7 +2316,7 @@ static void __bt_devices_list_free(void)
 
        node = g_list_first(p_cache_list);
 
-       while (node != NULL){
+       while (node != NULL) {
                cache_info = (bt_cache_info_t *)node->data;
                p_cache_list = g_list_remove(p_cache_list, cache_info);
                __bt_free_cache_info(cache_info);
@@ -2330,13 +2329,13 @@ static int __bt_parse_event(GVariant *msg)
 {
        GVariantIter iter;
        GVariant *child;
-       char *interface_name= NULL;
+       char *interface_name = NULL;
        GVariant *inner_iter = NULL;
 
        g_variant_iter_init(&iter, msg);
 
        while ((child = g_variant_iter_next_value(&iter))) {
-               g_variant_get(child,"{&s@a{sv}}", &interface_name, &inner_iter);
+               g_variant_get(child, "{&s@a{sv}}", &interface_name, &inner_iter);
                if (g_strcmp0(interface_name,
                                BT_DEVICE_INTERFACE) == 0) {
                        g_variant_unref(inner_iter);
@@ -2385,8 +2384,7 @@ static  void __bt_manager_event_filter(GDBusConnection *connection,
 #else
                        _bt_handle_adapter_added();
 #endif
-               }
-               else {
+               } else {
                        bt_event = __bt_parse_event(value);
                        if (bt_event == BT_DEVICE_EVENT) {
                                bt_cache_info_t *cache_info;
@@ -2448,7 +2446,7 @@ static  void __bt_manager_event_filter(GDBusConnection *connection,
                                GVariantBuilder *builder = NULL;
                                int i = 0;
                                builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
-                               for (i=0; i < dev_info->uuid_count; i++) {
+                               for (i = 0; i < dev_info->uuid_count; i++) {
                                        g_variant_builder_add(builder, "s",
                                                dev_info->uuids[i]);
                                }
@@ -2585,7 +2583,7 @@ static gboolean __bt_is_obexd_event(GVariant *msg, const char *interface)
        if (g_strcmp0(interface, BT_PROPERTIES_INTERFACE) == 0) {
                char *interface_name = NULL;
 
-               g_variant_get(msg,"(&s@a{sv}@as)", &interface_name, NULL, NULL);
+               g_variant_get(msg, "(&s@a{sv}@as)", &interface_name, NULL, NULL);
                retv_if(interface_name == NULL, FALSE);
 
                if (strcasecmp(interface_name, BT_OBEX_TRANSFER_INTERFACE) == 0) {
@@ -2677,7 +2675,7 @@ static gboolean __bt_is_obexd_client_event(GVariant *msg, const char *interface)
        if (g_strcmp0(interface, BT_PROPERTIES_INTERFACE) == 0) {
                char *interface_name = NULL;
 
-               g_variant_get(msg,"(&s@a{sv}@as)", &interface_name, NULL, NULL);
+               g_variant_get(msg, "(&s@a{sv}@as)", &interface_name, NULL, NULL);
 
                retv_if(interface_name == NULL, FALSE);
 
@@ -2705,22 +2703,21 @@ static  void __bt_opc_event_filter(GDBusConnection *connection,
        char *obj_path = NULL;
        if (strcasecmp(member, "InterfacesAdded") == 0) {
                BT_DBG("InterfacesAdded");
-       }else if (strcasecmp(member, "InterfacesRemoved") == 0) {
+       } else if (strcasecmp(member, "InterfacesRemoved") == 0) {
 
                if (__bt_get_object_path(parameters, &obj_path)) {
                        BT_ERR("Fail to get the path");
                        return;
                }
 
-               BT_DBG("object_path =%s",obj_path);
+               BT_DBG("object_path = %s", obj_path);
 
                if (strncmp(obj_path, BT_SESSION_BASEPATH_CLIENT,
                                strlen(BT_SESSION_BASEPATH_CLIENT)) != 0
                                || strstr(obj_path, "transfer") == NULL) {
                        g_free(obj_path);
                        return;
-               }
-               else if (strncmp(obj_path, BT_SESSION_BASEPATH_CLIENT,
+               } else if (strncmp(obj_path, BT_SESSION_BASEPATH_CLIENT,
                                strlen(BT_SESSION_BASEPATH_CLIENT)) == 0) {
                        BT_DBG("Going to call opc disconnected");
                        _bt_opc_disconnected(obj_path);
@@ -2728,7 +2725,7 @@ static  void __bt_opc_event_filter(GDBusConnection *connection,
 
                _bt_sending_files();
                g_free(obj_path);
-       }else if (__bt_is_obexd_client_event(parameters, interface_name) == TRUE){
+       } else if (__bt_is_obexd_client_event(parameters, interface_name) == TRUE) {
                char *path = (char *)object_path;
                BT_INFO("object_path %s", path);
                if (strncmp(path, BT_SESSION_BASEPATH_CLIENT,
index f3e4964..f5ba554 100755 (executable)
@@ -316,7 +316,7 @@ gboolean gap_agent_reply_authorize(GapAgentPrivate *agent, const guint accept,
                if (accept == GAP_AGENT_ACCEPT) {
                        g_dbus_method_invocation_return_value(priv->reply_context, NULL);
                } else if (accept == GAP_AGENT_ACCEPT_ALWAYS) {
-                       bluetooth_device_address_t addr = {{0,}};
+                       bluetooth_device_address_t addr = { {0,} };
                        int result;
 
                        _bt_convert_addr_string_to_type(addr.addr,
index e178db8..bb76def 100755 (executable)
@@ -123,15 +123,16 @@ gboolean connect_remote_media_audio(gpointer user_data)
 void _bt_get_bluetooth_device_info(char *remote_address, bluetooth_device_info_t *device)
 {
        GArray *dev_list = NULL;
-       int size,i=0;
+       int size = 0;
+       int i = 0;
        bluetooth_device_info_t info;
        char bond_address[BT_ADDRESS_STRING_SIZE] = { 0 };
-       dev_list = g_array_new (FALSE, FALSE, sizeof(gchar));
+       dev_list = g_array_new(FALSE, FALSE, sizeof(gchar));
        if (device == NULL)
                return;
        _bt_get_bonded_devices(&dev_list);
        size = (dev_list->len) / sizeof(bluetooth_device_info_t);
-       for (i=0; i < size; i++) {
+       for (i = 0; i < size; i++) {
                info = g_array_index(dev_list, bluetooth_device_info_t, i);
                _bt_convert_addr_type_to_string(bond_address, info.device_address.addr);
                if (strcmp(bond_address, remote_address) == 0) {
@@ -164,14 +165,16 @@ void _bt_headset_add_timer_function(int connection_type, bluetooth_device_info_t
 void _bt_start_timer_for_connection(char *remote_address, int connection_type)
 {
        GArray *dev_list = NULL;
-       int size,i=0,j;
+       int size;
+       int i;
+       int j;
        bluetooth_device_info_t info;
        char bond_address[BT_ADDRESS_STRING_SIZE] = { 0 };
-       dev_list = g_array_new (FALSE, FALSE, sizeof(gchar));
+       dev_list = g_array_new(FALSE, FALSE, sizeof(gchar));
        _bt_get_bonded_devices(&dev_list);
        size = (dev_list->len) / sizeof(bluetooth_device_info_t);
 
-       for (i=0; i < size; i++) {
+       for (i = 0; i < size; i++) {
                info = g_array_index(dev_list, bluetooth_device_info_t, i);
                j = 0;
                _bt_convert_addr_type_to_string(bond_address,
@@ -214,8 +217,7 @@ void __bt_connection_manager_set_state(char *remote_address, int event)
                                info->dev_info.device_address.addr);
                BT_INFO("Adding HFP Connected device to list");
                p_connection_list = g_list_append(p_connection_list, info);
-       }
-       else if (event == BLUETOOTH_EVENT_AG_DISCONNECTED) {
+       } else if (event == BLUETOOTH_EVENT_AG_DISCONNECTED) {
                /* Delete coresponding node */
                BT_INFO("Deleting HFP Connected device from list");
                GList *list = NULL;
index f0d967a..e6951e4 100755 (executable)
@@ -91,7 +91,7 @@ done:
        }
 }
 
-static void __bt_hid_disconnect_cb(GDBusProxy *proxy,GAsyncResult *res,
+static void __bt_hid_disconnect_cb(GDBusProxy *proxy, GAsyncResult *res,
                                        gpointer user_data)
 {
        GError *g_error = NULL;
index 0ecc306..a5e73d6 100755 (executable)
@@ -79,7 +79,7 @@ gboolean _bt_terminate_service(gpointer user_data)
                BT_ERR("no bluetooth device info, so BT was disabled at previous session");
        } else {
                if (bt_status != VCONFKEY_BT_STATUS_OFF) {
-                       if(vconf_set_int(VCONFKEY_BT_STATUS,
+                       if (vconf_set_int(VCONFKEY_BT_STATUS,
                                        VCONFKEY_BT_STATUS_OFF) != 0)
                                BT_ERR("Set vconf failed\n");
 
@@ -93,7 +93,7 @@ gboolean _bt_terminate_service(gpointer user_data)
                BT_ERR("no bluetooth device info, so BT was disabled at previous session");
        } else {
                if (bt_status != VCONFKEY_BT_LE_STATUS_OFF) {
-                       if(vconf_set_int(VCONFKEY_BT_LE_STATUS,
+                       if (vconf_set_int(VCONFKEY_BT_LE_STATUS,
                                        VCONFKEY_BT_LE_STATUS_OFF) != 0)
                                BT_ERR("Set vconf failed\n");
                        if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_LE_STATE,
@@ -205,7 +205,7 @@ static gboolean __bt_check_bt_service(void *data)
                BT_DBG("State: %d, LE State: %d", status, le_status);
 
                if ((status != BT_ACTIVATING && status != BT_ACTIVATED) &&
-                               (le_status != BT_LE_ACTIVATING && le_status != BT_LE_ACTIVATED)){
+                               (le_status != BT_LE_ACTIVATING && le_status != BT_LE_ACTIVATED)) {
                        _bt_terminate_service(NULL);
                }
        }
index 04b018a..78e7cb5 100755 (executable)
@@ -121,7 +121,7 @@ int _bt_is_network_connected(void *connection, unsigned char *address,
        handle = __bt_get_net_profile(connection,
                                CONNECTION_ITERATOR_TYPE_CONNECTED,
                                address);
-       if(handle)
+       if (handle)
                *is_connected = TRUE;
        else
                *is_connected = FALSE;
index 114aa1e..08f60eb 100755 (executable)
@@ -382,7 +382,7 @@ void _bt_obex_agent_new(char *path)
                        return;
                }
        }
-       info = (bt_obex_agent_info *)malloc (sizeof(bt_obex_agent_info));
+       info = (bt_obex_agent_info *)malloc(sizeof(bt_obex_agent_info));
        if (info) {
                memset(info, 0, sizeof(bt_obex_agent_info));
                info->path = g_strdup(path);
@@ -527,7 +527,7 @@ void _bt_obex_set_progress_cb(char *object_path,
 void _bt_obex_set_complete_cb(char *object_path,
                        bt_obex_complete_cb func, gpointer data)
 {
-       bt_obex_agent_info *info =__find_obex_agent_info(object_path);;
+       bt_obex_agent_info *info = __find_obex_agent_info(object_path);;
 
        /* Fix : NULL_RETURNS */
        if (info == NULL)
index 29b34f3..ebc4915 100644 (file)
@@ -317,7 +317,7 @@ static GDBusProxy *__bt_get_transfer_properties_proxy(const char *transfer_path)
        retv_if(conn == NULL, NULL);
 
        proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
-                                       NULL,BT_OBEX_SERVICE_NAME,
+                                       NULL, BT_OBEX_SERVICE_NAME,
                                        transfer_path,
                                        BT_PROPERTIES_INTERFACE,
                                        NULL, &err);
@@ -455,7 +455,7 @@ static gboolean __bt_authorize_cb(GDBusMethodInvocation *context,
        agent_info.auth_info->transfer_path = g_strdup(path);
 
 #ifdef TIZEN_DPM_ENABLE
-       if(_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_HANDSFREE_ONLY) {
+       if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_HANDSFREE_ONLY) {
                /* Free auth info in next function */
                _bt_obex_server_reject_authorize();
                return FALSE;
@@ -468,7 +468,7 @@ static gboolean __bt_authorize_cb(GDBusMethodInvocation *context,
                gsize len = 0;
                while (g_variant_iter_loop(iter, "{sv}", &key, &val)) {
                        if (g_strcmp0(key, "Name") == 0) {
-                               agent_info.auth_info->filename = g_variant_dup_string(val,&len);
+                               agent_info.auth_info->filename = g_variant_dup_string(val, &len);
                        } else if (g_strcmp0(key, "Address") == 0) {
                                bdaddress = g_variant_dup_string(val, &len);
                        } else if (g_strcmp0(key, "Size") == 0) {
@@ -876,7 +876,7 @@ int _bt_obex_server_accept_authorize(const char *filename, gboolean is_native)
                snprintf(file_path, sizeof(file_path), "%s", filename);
 
        g_dbus_method_invocation_return_value(agent_info.auth_info->reply_context,
-               g_variant_new("(s)",&file_path));
+               g_variant_new("(s)", &file_path));
        agent_info.auth_info->reply_context = NULL;
        agent_info.auth_info->file_path = g_strdup(file_path);
 
index 77ffa3c..2762813 100755 (executable)
@@ -76,10 +76,10 @@ int _bt_oob_read_local_data(bt_oob_data_t *local_oob_data)
                return BLUETOOTH_ERROR_INTERNAL;
        }
 
-       g_variant_get(reply ,"(@ay@ay)", &hash, &randomizer);
+       g_variant_get(reply"(@ay@ay)", &hash, &randomizer);
        g_variant_unref(reply);
 
-       if(hash != NULL){
+       if (hash != NULL) {
                local_oob_data->hash_len = (unsigned int)g_variant_get_size(hash);
                local_hash = (unsigned char *)g_variant_get_data(hash);
        } else {
@@ -89,7 +89,7 @@ int _bt_oob_read_local_data(bt_oob_data_t *local_oob_data)
 
        g_variant_unref(hash);
 
-       if(randomizer != NULL){
+       if (randomizer != NULL) {
                local_oob_data->randomizer_len = (unsigned int)g_variant_get_size(randomizer);
                local_randomizer = (unsigned char *)g_variant_get_data(randomizer);
        } else {
index d0174f7..9b229ec 100755 (executable)
@@ -527,7 +527,7 @@ void _bt_sending_files(void)
 
        if (sending_info == NULL)
                return;
-       if (file_offset < sending_info->file_count){
+       if (file_offset < sending_info->file_count) {
                /* Get the session bus. */
                g_conn = _bt_get_session_gconn();
                ret_if(g_conn == NULL);
@@ -559,7 +559,7 @@ void _bt_sending_files(void)
                }
 
                g_free(mimetype);
-       }else{
+       } else {
                file_offset = 0;
                __bt_sending_release();
        }
@@ -592,9 +592,9 @@ static void __bt_create_session_cb(GDBusProxy *proxy,
                g_clear_error(&error);
 
                result = BLUETOOTH_ERROR_INTERNAL;
-       }else{
+       } else {
                BT_DBG("Session created");
-               if(sending_info != NULL)
+               if (sending_info != NULL)
                        sending_info->session_path = g_strdup(session_path);
        }
        g_free(session_path);
@@ -615,7 +615,7 @@ static void __bt_create_session_cb(GDBusProxy *proxy,
 
                __bt_free_sending_info(sending_info);
                sending_info = NULL;
-       }else {
+       } else {
                BT_DBG("Calling sending_files");
                _bt_sending_files();
        }
index f5a81b8..46f5254 100644 (file)
@@ -208,7 +208,7 @@ void _bt_pbap_obex_transfer_completed(const char *transfer_path, gboolean transf
        signal = g_variant_new("(issi)", result,
                        transfer_info->remote_device,
                        transfer_info->filename, success);
-       switch(transfer_info->operation) {
+       switch (transfer_info->operation) {
        case PULL_ALL: {
                _bt_send_event(BT_PBAP_CLIENT_EVENT,
                                        BLUETOOTH_PBAP_PHONEBOOK_PULL,
@@ -603,19 +603,19 @@ void __bt_pbap_get_vcard_list_cb(GDBusProxy *proxy,
                GVariant *child = NULL;
                GVariant *value1 = NULL;
 
-               g_variant_get(value ,"(@a(ss))", &value1); /* Format for value1 a(ss)*/
-               gsize items = g_variant_iter_init (&iter, value1);
+               g_variant_get(value"(@a(ss))", &value1); /* Format for value1 a(ss)*/
+               gsize items = g_variant_iter_init(&iter, value1);
                vcard_list = g_new0(char *, items + 1);
 
-               for (i = 0; (child = g_variant_iter_next_value (&iter)) != NULL; i++) {
-                       g_variant_get(child ,"(&s&s)", &elname, &elval);
+               for (i = 0; (child = g_variant_iter_next_value(&iter)) != NULL; i++) {
+                       g_variant_get(child"(&s&s)", &elname, &elval);
 
                        memset(list_entry, 0, PBAP_VCARDLIST_MAXLENGTH);
 #if 0
-                       g_snprintf (list_entry, PBAP_VCARDLIST_MAXLENGTH - 1,
+                       g_snprintf(list_entry, PBAP_VCARDLIST_MAXLENGTH - 1,
                                        "<card handle = \"%s\" name = \"%s\"/>", elname, elval);
 #else
-                       g_snprintf (list_entry, PBAP_VCARDLIST_MAXLENGTH - 1,
+                       g_snprintf(list_entry, PBAP_VCARDLIST_MAXLENGTH - 1,
                                        "%s", elval);
 #endif
                        //If possible send as Array of <STRING, STRING>
@@ -630,7 +630,7 @@ void __bt_pbap_get_vcard_list_cb(GDBusProxy *proxy,
        }
 
        BT_DBG("Address = %s", address_string);
-       GVariant *temp = g_variant_new_strv((const gchar * const*)vcard_list, length);
+       GVariant *temp = g_variant_new_strv((const gchar*)vcard_list, length);
        signal = g_variant_new("(isv)", result, address_string, temp);
 
        _bt_send_event(BT_PBAP_CLIENT_EVENT,
@@ -671,7 +671,7 @@ void __bt_pbap_get_vcard_cb(GDBusProxy *proxy,
        } else {
                g_variant_get(value, "(o@a{sv})", &transfer, &properties);
 
-               if (g_variant_lookup (properties, "Filename", "s", &filename) == FALSE)
+               if (g_variant_lookup(properties, "Filename", "s", &filename) == FALSE)
                        filename = NULL;
 
                BT_DBG("Transfer Path: %s", transfer);
@@ -723,15 +723,15 @@ void __bt_pbap_search_phonebook_cb(GDBusProxy *proxy,
                GVariant *child = NULL;
                GVariant *value1 = NULL;
 
-               g_variant_get(value ,"(@a(ss))", &value1);
-               gsize items = g_variant_iter_init (&iter, value1);
+               g_variant_get(value"(@a(ss))", &value1);
+               gsize items = g_variant_iter_init(&iter, value1);
                vcard_list = g_new0(char *, items + 1);
 
-               for (i = 0; (child = g_variant_iter_next_value (&iter)) != NULL; i++) {
+               for (i = 0; (child = g_variant_iter_next_value(&iter)) != NULL; i++) {
                        g_variant_get(child, "(&s&s)", &elname, &elval);
 
                        memset(list_entry, 0, PBAP_VCARDLIST_MAXLENGTH);
-                       g_snprintf (list_entry, PBAP_VCARDLIST_MAXLENGTH - 1,
+                       g_snprintf(list_entry, PBAP_VCARDLIST_MAXLENGTH - 1,
                                        "<card handle = \"%s\" name = \"%s\"/>", elname, elval);
                        //If possible send as Array of <STRING, STRING>
                        BT_DBG("%s", list_entry);
@@ -747,7 +747,7 @@ void __bt_pbap_search_phonebook_cb(GDBusProxy *proxy,
        BT_DBG("Address = %s", address_string);
 
        signal = g_variant_new("(is@as)", result, address_string,
-                       g_variant_new_strv((const gchar * const*)vcard_list, length));
+                       g_variant_new_strv((const gchar *)vcard_list, length));
 
        _bt_send_event(BT_PBAP_CLIENT_EVENT,
                                BLUETOOTH_PBAP_PHONEBOOK_SEARCH,
@@ -792,24 +792,24 @@ int __bt_pbap_call_get_phonebook(GDBusProxy *proxy, bt_pbap_data_t *pbap_data)
        GVariant *filters;
 
 
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
-       g_variant_builder_init (&inner_builder, G_VARIANT_TYPE_ARRAY);
+       g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY);
+       g_variant_builder_init(&inner_builder, G_VARIANT_TYPE_ARRAY);
 
        /* Add MaxlistCount*/
        g_variant_builder_add(&builder, "{sv}", "MaxCount",
-                                       g_variant_new("u",app_param->maxlist));
+                                       g_variant_new("u", app_param->maxlist));
 
        /* Add Order Filter only if other than Indexed (default)*/
        if (app_param->order > 0) {
                order_str = g_strdup(ORDER[app_param->order]);
                g_variant_builder_add(&builder, "{sv}", "Order",
-                               g_variant_new("s",order_str));
+                               g_variant_new("s", order_str));
        }
 
        /* Add Offset Filter only if other than 0 (default)*/
        if (app_param->offset > 0) {
                g_variant_builder_add(&builder, "{sv}", "Offset",
-                                               g_variant_new("u",app_param->offset));
+                                               g_variant_new("u", app_param->offset));
        }
 
        /* Add Format Filter only if other than vCard 2.1 (default)*/
@@ -887,23 +887,23 @@ int __bt_pbap_call_get_vcards_list(GDBusProxy *proxy, bt_pbap_data_t *pbap_data)
 
        bt_pbap_list_parameters_t *app_param = pbap_data->app_param;
 
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
+       g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY);
 
        /* Add MaxlistCount*/
        g_variant_builder_add(&builder, "{sv}", "MaxCount",
-                                       g_variant_new("u",app_param->maxlist));
+                                       g_variant_new("u", app_param->maxlist));
 
        /* Add Order Filter only if other than Indexed (default)*/
        if (app_param->order > 0) {
                order_str = g_strdup(ORDER[app_param->order]);
                g_variant_builder_add(&builder, "{sv}", "Order",
-                               g_variant_new("s",order_str));
+                               g_variant_new("s", order_str));
        }
 
        /* Add Offset Filter only if other than 0 (default)*/
        if (app_param->offset > 0) {
                g_variant_builder_add(&builder, "{sv}", "Offset",
-                                               g_variant_new("u",app_param->offset));
+                                               g_variant_new("u", app_param->offset));
        }
 
        filters = g_variant_builder_end(&builder);
@@ -946,8 +946,8 @@ int __bt_pbap_call_get_vcard(GDBusProxy *proxy, bt_pbap_data_t *pbap_data)
        GVariant *filters;
        bt_pbap_pull_vcard_parameters_t *app_param = pbap_data->app_param;
 
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
-       g_variant_builder_init (&inner_builder, G_VARIANT_TYPE_ARRAY);
+       g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY);
+       g_variant_builder_init(&inner_builder, G_VARIANT_TYPE_ARRAY);
 
        /* Add Format Filter only if other than vCard 2.1 (default)*/
 //     if (app_param->format > 0) {
@@ -1036,23 +1036,23 @@ int __bt_pbap_call_search_phonebook(GDBusProxy *proxy, bt_pbap_data_t *pbap_data
        GVariantBuilder builder;
        GVariant *filters;
 
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
+       g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY);
 
        /* Add MaxlistCount*/
        g_variant_builder_add(&builder, "{sv}", "MaxCount",
-                                       g_variant_new("u",app_param->maxlist));
+                                       g_variant_new("u", app_param->maxlist));
 
        /* Add Order Filter only if other than Indexed (default)*/
        if (app_param->order > 0) {
                order_str = g_strdup(ORDER[app_param->order]);
                g_variant_builder_add(&builder, "{sv}", "Order",
-                               g_variant_new("s",order_str));
+                               g_variant_new("s", order_str));
        }
 
        /* Add Offset Filter only if other than 0 (default)*/
        if (app_param->offset > 0) {
                g_variant_builder_add(&builder, "{sv}", "Offset",
-                                               g_variant_new("u",app_param->offset));
+                                               g_variant_new("u", app_param->offset));
        }
 
        filters = g_variant_builder_end(&builder);
index b01b955..40d7e38 100755 (executable)
@@ -81,8 +81,7 @@ extern "C" {
 
 #define BT_CHECK_PARAMETER(arg, func) \
        do { \
-               if (arg == NULL) \
-               { \
+               if (arg == NULL) { \
                        BT_ERR("%s is NULL", #arg); \
                        func BLUETOOTH_ERROR_INVALID_PARAM; \
                } \
@@ -255,16 +254,16 @@ typedef enum {
 } bt_le_device_info_type_t;
 
 typedef enum {
-       BT_PROFILE_CONN_RFCOMM= 0x01,
-       BT_PROFILE_CONN_A2DP= 0x02,
-       BT_PROFILE_CONN_HSP= 0x04,
-       BT_PROFILE_CONN_HID= 0x08,
-       BT_PROFILE_CONN_NAP= 0x10,
-       BT_PROFILE_CONN_HFG= 0x20,
-       BT_PROFILE_CONN_GATT= 0x40,
+       BT_PROFILE_CONN_RFCOMM = 0x01,
+       BT_PROFILE_CONN_A2DP = 0x02,
+       BT_PROFILE_CONN_HSP = 0x04,
+       BT_PROFILE_CONN_HID = 0x08,
+       BT_PROFILE_CONN_NAP = 0x10,
+       BT_PROFILE_CONN_HFG = 0x20,
+       BT_PROFILE_CONN_GATT = 0x40,
        BT_PROGILE_CONN_NAP = 0x80,
-       BT_PROFILE_CONN_A2DP_SINK= 0x100,
-       BT_PROFILE_CONN_ALL= 0xffffffff,
+       BT_PROFILE_CONN_A2DP_SINK = 0x100,
+       BT_PROFILE_CONN_ALL = 0xffffffff,
 } bt_profile_type_t;
 
 typedef struct {