From: qunfang.lin Date: Thu, 9 Jul 2020 03:04:46 +0000 (+0800) Subject: [common][bluetooth][TFDF-10685, fix Error CreatingBonding in helper wgt] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F48%2F238148%2F2;p=test%2Ftct%2Fweb%2Fapi.git [common][bluetooth][TFDF-10685, fix Error CreatingBonding in helper wgt] Optimize the destroy bonding code Change-Id: Idd6321d9328431b2412184c49fcd2e9233f88360 Signed-off-by: qunfang.lin --- diff --git a/common/tct-bluetooth-tizen-tests/tct-bt-helper/js/main.js b/common/tct-bluetooth-tizen-tests/tct-bt-helper/js/main.js index c0a91fc23..187aa317a 100755 --- a/common/tct-bluetooth-tizen-tests/tct-bt-helper/js/main.js +++ b/common/tct-bluetooth-tizen-tests/tct-bt-helper/js/main.js @@ -23,7 +23,7 @@ Authors: */ var serviceHandler = null; -var connected_remote_device_address = null; +var selected_device_address = null; function discoverDevicesError() { alert("Error discoverDevices"); @@ -117,7 +117,6 @@ function connectCallback(device) { if (device != null && device.uuids.indexOf(document.getElementById("serviceTxt").value) !== -1) { // open socket device.connectToServiceByUUID(document.getElementById("serviceTxt").value, function() { - connected_remote_device_address = device.address; alert("connected"); },connectError); } else { @@ -130,9 +129,10 @@ function getDeviceCallback() { } function createBondingCallback() { - adapter.destroyBonding(connected_remote_device_address); + selected_device_address = document.getElementById("devicesList").value; + adapter.destroyBonding(selected_device_address); setTimeout(function() { - adapter.createBonding(document.getElementById("devicesList").value, getDeviceCallback, createBondingError); + adapter.createBonding(selected_device_address, getDeviceCallback, createBondingError); }, 3000); }