[Non-ACR][Bluetooth][Manual][Use the correct purpose address] 38/199438/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 11 Feb 2019 09:43:35 +0000 (18:43 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 11 Feb 2019 09:43:35 +0000 (18:43 +0900)
Change-Id: Ic65b8a9b592a7b687152be4b5cbd794af46ffd0a
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/BluetoothSetup.cs
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/PreconditionUtils.cs
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAuthorizationChangedEventArgs.cs
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothDevice.cs
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothDeviceSdpData.cs
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBondCreatedEventArgs.cs
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBondDestroyedEventArgs.cs
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSDeviceConnectionStateChangedEventArgs.cs
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSPushProgressEventArgs.cs
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSPushRespondedEventArgs.cs

index 166bb528d5efd188a7a9ed8a4b163382b23b3cad..75182614dd58e7890cb1ed860bf7be8ab0bb15e4 100644 (file)
@@ -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)
             {
index f4c3e2d923cc508836b45ea3538d1e63c3ea46e8..9e14081439457eebb09bd77b0a90a1223b3ddb60 100755 (executable)
@@ -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("\\", "");
index 3942f91d118d6b519cb328d1ce945c5d9494e6ac..3338d5e6fe6bf1d1bc3f14f12f0ff6bafda034bc 100755 (executable)
@@ -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]
index f01848948e362aa1e37220d9f1e2ffcc0853ca97..52c7de2f6d59ae42d2c62008d7bcc889a72d5aef 100755 (executable)
@@ -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]
index 1ea2f6598ac3a4cf1b1f02b12753649c0e0e122d..26a138367d429c8721898d8df07ce6776034dfa7 100755 (executable)
@@ -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()
index 1016d6ea82341d0524944d33eae32a6534485339..f1784f7f8c92b61cccfd86eadb5bbdfbd5e54421 100755 (executable)
@@ -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]
index 70e29173f14759c7458fbefcd6748cd14600f48d..8c6296701601912e6e27371c1880e55a541af963 100755 (executable)
@@ -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]
index 46b5310fe72485d31ca3b92df1884b7f3b1e436e..25442aadf49d2ec73fa30d5d7d610a83373086b2 100755 (executable)
@@ -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]
index fd4c6ff535ed20fd1b54acc8d7dfd805e48a4627..b534fdf2c2e3fdc4e01448974753603086dcacdf 100755 (executable)
@@ -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]
index 41acf0860de62687f58b3c6511c17bafe415d295..e7e10279ae139d7fffe2fd3631eec94b2212d488 100755 (executable)
@@ -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]