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";
{
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);
}
{
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;
if (BtOppClient != null)
return BtOppClient;
- pairedDevice = BluetoothAdapter.GetBondedDevice(remote_addr);
+ pairedDevice = BluetoothAdapter.GetBondedDevice(remote_opp_addr);
if (pairedDevice != null)
{
{
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)
{
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("\\", "");
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]
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]
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()
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]
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]
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]
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]
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]