From: Wootak Jung Date: Fri, 25 Oct 2019 04:57:39 +0000 (+0900) Subject: Fix scan device found callback unset issue X-Git-Tag: submit/tizen/20191031.005137^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94b6647989fc79b6663080e152bf03e2a71e18f3;p=platform%2Fcore%2Fapi%2Fbluetooth.git Fix scan device found callback unset issue callback should be not unset if operation is failed Change-Id: I22c1269b80d803e03ab659b2c211c6c162417746 --- diff --git a/src/bluetooth-adapter.c b/src/bluetooth-adapter.c index 1777f25..e112d84 100644 --- a/src/bluetooth-adapter.c +++ b/src/bluetooth-adapter.c @@ -2875,13 +2875,14 @@ int bt_adapter_le_start_scan(bt_adapter_le_scan_result_cb cb, void *user_data) BT_CHECK_INPUT_PARAMETER(cb); _bt_le_adapter_init(); - _bt_set_cb(BT_EVENT_LE_SCAN_RESULT_UPDATED, cb, user_data); error_code = _bt_get_error_code(bluetooth_start_le_discovery()); if (error_code != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), - error_code); /* LCOV_EXCL_LINE */ + BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); /* LCOV_EXCL_LINE */ + return error_code; } + + _bt_set_cb(BT_EVENT_LE_SCAN_RESULT_UPDATED, cb, user_data); return error_code; } @@ -2894,13 +2895,12 @@ int bt_adapter_le_stop_scan(void) error_code = _bt_get_error_code(bluetooth_stop_le_discovery()); if (error_code != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), - error_code); /* LCOV_EXCL_LINE */ + BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); /* LCOV_EXCL_LINE */ + return error_code; } _bt_unset_cb(BT_EVENT_LE_SCAN_RESULT_UPDATED); _bt_le_adapter_deinit(); - return error_code; }