From: DoHyun Pyun Date: Mon, 11 Feb 2019 09:43:35 +0000 (+0900) Subject: [Non-ACR][Bluetooth][Manual][Use the correct purpose address] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f17386fdf54f17774bd8a6eee0e8a28013d853da;p=test%2Ftct%2Fcsharp%2Fapi.git [Non-ACR][Bluetooth][Manual][Use the correct purpose address] Change-Id: Ic65b8a9b592a7b687152be4b5cbd794af46ffd0a Signed-off-by: DoHyun Pyun --- diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/BluetoothSetup.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/BluetoothSetup.cs index 166bb52..7518261 100644 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/BluetoothSetup.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/BluetoothSetup.cs @@ -46,7 +46,9 @@ namespace BluetoothNetworkUtils public static BluetoothLeDevice BtLeDevice = null; public static BluetoothLeDevice BtLeScanDevice = null; public static BluetoothError result; - public static string remote_addr = PreconditionUtils.GetBleAddress(); + public static string remote_addr = PreconditionUtils.GetBtAddress(); + public static string remote_opp_addr = PreconditionUtils.GetOppAddress(); + public static string remote_ble_addr = PreconditionUtils.GetBleAddress(); public static string default_remote_addr = PreconditionUtils.GetDefaultAddress(); public static string HspHsUuid = "00001108-0000-1000-8000-00805F9B34FB"; public static string HspAgUuid = "00001112-0000-1000-8000-00805F9B34FB"; @@ -624,14 +626,14 @@ namespace BluetoothNetworkUtils { if (e.DeviceData != null) { - if (remote_addr.Equals(default_remote_addr)) + if (remote_ble_addr.Equals(default_remote_addr)) { if (BtLeDevice != null) return; LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Use the first found device"); } - else if (e.DeviceData.RemoteAddress.Equals(remote_addr)) + else if (e.DeviceData.RemoteAddress.Equals(remote_ble_addr)) { LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Found the matching device" + e.DeviceData.RemoteAddress); } @@ -882,7 +884,7 @@ namespace BluetoothNetworkUtils { if (e.Result == (int)BluetoothError.None) { - if (!e.RemoteAddress.Equals(remote_addr)) + if (!e.RemoteAddress.Equals(remote_ble_addr)) { Log.Info(Globals.LogTag, "Not equal with BLE address, ignore it"); return; @@ -997,7 +999,7 @@ namespace BluetoothNetworkUtils if (BtOppClient != null) return BtOppClient; - pairedDevice = BluetoothAdapter.GetBondedDevice(remote_addr); + pairedDevice = BluetoothAdapter.GetBondedDevice(remote_opp_addr); if (pairedDevice != null) { diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/PreconditionUtils.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/PreconditionUtils.cs index f4c3e2d..9e14081 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/PreconditionUtils.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/PreconditionUtils.cs @@ -22,11 +22,20 @@ namespace BluetoothNetworkUtils { public class PreconditionUtils { + public static string BT_REMOTE_DEVICE_ADDRESS = null; public static string BT_REMOTE_BLE_DEVICE_ADDRESS = null; public static string BT_REMOTE_HID_DEVICE_ADDRESS = null; public static string BT_REMOTE_OPP_DEVICE_ADDRESS = null; public static string default_remote_addr = "AA:AA:AA:AA:AA:AA"; + public static string GetBtAddress () + { + if (BT_REMOTE_DEVICE_ADDRESS == null) + SetPrecondition(); + + return BT_REMOTE_DEVICE_ADDRESS; + } + public static string GetBleAddress () { if (BT_REMOTE_BLE_DEVICE_ADDRESS == null) @@ -72,6 +81,10 @@ namespace BluetoothNetworkUtils { switch (item) { + case "BT_REMOTE_DEVICE_ADDRESS": + resultArray[index + 1] = resultArray[index + 1].Replace("\\", ""); + BT_REMOTE_DEVICE_ADDRESS = resultArray[index + 1]; + break; case "BT_REMOTE_BLE_DEVICE_ADDRESS": // Remove backslash resultArray[index + 1] = resultArray[index + 1].Replace("\\", ""); diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAuthorizationChangedEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAuthorizationChangedEventArgs.cs index 3942f91..3338d5e 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAuthorizationChangedEventArgs.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAuthorizationChangedEventArgs.cs @@ -18,7 +18,7 @@ namespace Tizen.Network.Bluetooth.Tests static BluetoothDevice bondedDevice; static BluetoothDevice foundDevice; static string address; - public static string remote_addr = PreconditionUtils.GetBleAddress(); + public static string remote_addr = PreconditionUtils.GetBtAddress(); public static string default_remote_addr = PreconditionUtils.GetDefaultAddress(); [SetUp] diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothDevice.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothDevice.cs index f018489..52c7de2 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothDevice.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothDevice.cs @@ -21,7 +21,7 @@ namespace Tizen.Network.Bluetooth.Tests static BluetoothDevice bondedDevice = null; static bool isBluetoothSupported = false; static bool isBluetoothLeSupported = false; - public static string remote_addr = PreconditionUtils.GetBleAddress(); + public static string remote_addr = PreconditionUtils.GetBtAddress(); public static string default_remote_addr = PreconditionUtils.GetDefaultAddress(); [SetUp] diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothDeviceSdpData.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothDeviceSdpData.cs index 1ea2f65..26a1383 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothDeviceSdpData.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothDeviceSdpData.cs @@ -19,7 +19,7 @@ namespace Tizen.Network.Bluetooth.Tests static BluetoothDeviceSdpData sdpData = null; static bool isBluetoothSupported = false; static bool isBluetoothLeSupported = false; - public static string remote_addr = PreconditionUtils.GetBleAddress(); + public static string remote_addr = PreconditionUtils.GetBtAddress(); [SetUp] public static void Init() diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBondCreatedEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBondCreatedEventArgs.cs index 1016d6e..f1784f7 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBondCreatedEventArgs.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBondCreatedEventArgs.cs @@ -17,7 +17,7 @@ namespace Tizen.Network.Bluetooth.Tests static BluetoothDevice bondedDevice = null; static bool isBluetoothSupported = false; static bool isBluetoothLeSupported = false; - public static string remote_addr = PreconditionUtils.GetBleAddress(); + public static string remote_addr = PreconditionUtils.GetBtAddress(); public static string default_remote_addr = PreconditionUtils.GetDefaultAddress(); [SetUp] diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBondDestroyedEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBondDestroyedEventArgs.cs index 70e2917..8c62967 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBondDestroyedEventArgs.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBondDestroyedEventArgs.cs @@ -18,7 +18,7 @@ namespace Tizen.Network.Bluetooth.Tests static string address; static bool isBluetoothSupported = false; static bool isBluetoothLeSupported = false; - public static string remote_addr = PreconditionUtils.GetBleAddress(); + public static string remote_addr = PreconditionUtils.GetBtAddress(); public static string default_remote_addr = PreconditionUtils.GetDefaultAddress(); [SetUp] diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSDeviceConnectionStateChangedEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSDeviceConnectionStateChangedEventArgs.cs index 46b5310..25442aa 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSDeviceConnectionStateChangedEventArgs.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSDeviceConnectionStateChangedEventArgs.cs @@ -15,7 +15,7 @@ namespace Tizen.Network.Bluetooth.Tests static bool flagDeviceDiscovery = false; static BluetoothDevice device = null; static bool isBluetoothSupported = false; - public static string remote_addr = PreconditionUtils.GetBleAddress(); + public static string remote_addr = PreconditionUtils.GetBtAddress(); public static string default_remote_addr = PreconditionUtils.GetDefaultAddress(); [SetUp] diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSPushProgressEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSPushProgressEventArgs.cs index fd4c6ff..b534fdf 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSPushProgressEventArgs.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSPushProgressEventArgs.cs @@ -16,7 +16,7 @@ namespace Tizen.Network.Bluetooth.Tests static BluetoothDevice _device = null; static BluetoothOppClient _oppClient = null; private static string filePath = Path.Combine(Application.Current.DirectoryInfo.SharedResource, "test1.jpg"); - public static string _remoteAddress = PreconditionUtils.GetBleAddress(); + public static string _remoteAddress = PreconditionUtils.GetOppAddress(); static bool isBluetoothOppSupported = false; [SetUp] diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSPushRespondedEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSPushRespondedEventArgs.cs index 41acf08..e7e1027 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSPushRespondedEventArgs.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSPushRespondedEventArgs.cs @@ -16,7 +16,7 @@ namespace Tizen.Network.Bluetooth.Tests static BluetoothDevice _device = null; static BluetoothOppClient _oppClient = null; private static string filePath = Path.Combine(Application.Current.DirectoryInfo.SharedResource, "test1.jpg"); - public static string _remoteAddress = PreconditionUtils.GetBleAddress(); + public static string _remoteAddress = PreconditionUtils.GetOppAddress(); static bool isBluetoothOppSupported = false; [SetUp]