Not retry bonding even though bond fails 27/233327/1
authorDeokhyun Kim <dukan.kim@samsung.com>
Thu, 23 Apr 2020 04:39:57 +0000 (13:39 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 14 May 2020 02:14:11 +0000 (11:14 +0900)
Change-Id: I4060d2d9d838951f222107e5c26689ea4924d992
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
bt-service-adaptation/services/device/bt-service-core-device.c

index 1c2b298..b454651 100644 (file)
@@ -56,7 +56,9 @@
 #include <oal-adapter-mgr.h>
 #include <oal-device-mgr.h>
 
+#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IOT)
 #define MAX_BOND_RETRY_COUNT 3
+#endif
 #define BT_PASSKEY_MAX_LENGTH 4
 
 #define BT_LE_CONN_PARAM_DEFAULT_SUPERVISION_TIMEOUT    6000    /* msec */
@@ -133,7 +135,9 @@ typedef enum {
 
 /* BT device bond state variable */
 static bt_bond_state_e bt_device_bond_state;
+#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IOT)
 static int bond_retry_count;
+#endif
 
 static char *passkey_watcher;
 static GSList *pin_info_list = NULL;
@@ -867,6 +871,7 @@ static void __bt_device_handle_bond_failed_event(event_dev_bond_failed_t* bond_f
        case OAL_STATUS_RMT_DEVICE_DOWN:
        {
                if (trigger_bond_info) {
+#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IOT)
                        BT_INFO("OAL_STATUS_RMT_DEVICE_DOWN:Lets retry bonding!! retry count [%d]",
                                        bond_retry_count);
                        int ret = OAL_STATUS_SUCCESS;
@@ -882,13 +887,16 @@ static void __bt_device_handle_bond_failed_event(event_dev_bond_failed_t* bond_f
                                } else
                                        bond_retry_count++;
                        } else {
+#endif
                                BT_ERR("Create Bond failed MAX_BOND_RETRY_COUNT TIMES!!");
                                __bt_device_handle_pending_requests(BLUETOOTH_ERROR_INTERNAL, BT_BOND_DEVICE,
                                                trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
                                __bt_free_bond_info(BT_DEVICE_BOND_INFO);
                                __bt_free_pairing_info(&trigger_pairing_info);
+#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IOT)
                                bond_retry_count = 0;
                        }
+#endif
                }
                break;
        }
@@ -1815,7 +1823,9 @@ int _bt_bond_device(bluetooth_device_address_t *device_address,
                bt_device_bond_state = BT_DEVICE_BOND_STATE_REMOVE_BONDING;
        }
 
+#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IOT)
        bond_retry_count = 0;
+#endif
        result = __bt_device_handle_bond_state();
 
        if (result != BLUETOOTH_ERROR_NONE)