Exemplo n.º 1
0
        public void SetUp()
        {
            var e = new AutoResetEvent(false);

            mgrDelegate = new ManagerDelegate(e);
            mgr         = new CBCentralManager(mgrDelegate, new DispatchQueue("com.xamarin.tests." + TestContext.CurrentContext.Test.Name));
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            // Required API is available in macOS 10.8, but it doesn't work (hangs in 10.8-10.9, randomly crashes in 10.10) on the bots.
            TestRuntime.AssertSystemVersion(PlatformName.MacOSX, 10, 11, throwIfOtherPlatform: false);
            var e = new AutoResetEvent(false);

            mgrDelegate = new ManagerDelegate(e);
            mgr         = new CBCentralManager(mgrDelegate, new DispatchQueue("com.xamarin.tests." + TestContext.CurrentContext.Test.Name));
        }
Exemplo n.º 3
0
        public void SetUp()
        {
            // iOS 13 and friends require bluetooth permission
            if (TestRuntime.CheckXcodeVersion(11, 0))
            {
                TestRuntime.CheckBluetoothPermission();
            }
            //known UUID for a heart monitor, more common, we want to find something and make sure we do not crash
            heartRateMonitorUUID = CBUUID.FromPartial(0x180D);
            // Required API is available in macOS 10.8, but it doesn't work (hangs in 10.8-10.9, randomly crashes in 10.10) on the bots.
            TestRuntime.AssertSystemVersion(PlatformName.MacOSX, 10, 11, throwIfOtherPlatform: false);
            var e = new AutoResetEvent(false);

            mgrDelegate = new ManagerDelegate(e);
            mgr         = new CBCentralManager(mgrDelegate, new DispatchQueue("com.xamarin.tests." + TestContext.CurrentContext.Test.Name));
        }
Exemplo n.º 4
0
 public void SetUp()
 {
     // iOS 13 and friends require bluetooth permission
     if (TestRuntime.CheckXcodeVersion(11, 0))
     {
         TestRuntime.CheckBluetoothPermission(true);
     }
     //known UUID for a heart monitor, more common, we want to find something and make sure we do not crash
     heartRateMonitorUUID = CBUUID.FromPartial(0x180D);
     // Required API is available in macOS 10.8, but it doesn't work (hangs in 10.8-10.9, randomly crashes in 10.10) on the bots.
     TestRuntime.AssertSystemVersion(ApplePlatform.MacOSX, 10, 11, throwIfOtherPlatform: false);
     mgrDelegate = new ManagerDelegate();
     mgr         = new CBCentralManager(mgrDelegate, new DispatchQueue("com.xamarin.tests." + TestContext.CurrentContext.Test.Name));
     if (!mgrDelegate.PoweredOnEvent.WaitOne(TimeSpan.FromSeconds(5)))
     {
         Assert.Inconclusive("Bluetooth never turned on.");
     }
 }