[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 166bb52..7518261 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 f4c3e2d..9e14081 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 3942f91..3338d5e 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 f018489..52c7de2 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 1ea2f65..26a1383 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 1016d6e..f1784f7 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 70e2917..8c62967 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 46b5310..25442aa 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 fd4c6ff..b534fdf 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 41acf08..e7e1027 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]