예제 #1
0
        public AdapterContext(BleAdapterConfiguration config)
        {
            var opts = new CBCentralInitOptions
            {
                ShowPowerAlert = config?.ShowPowerAlert ?? false,
#if __IOS__
                RestoreIdentifier = config?.RestoreIdentifier ?? "pluginbluetoothle"
#endif
            };

            this.Manager = new CBCentralManager(this, config?.DispatchQueue, opts);
        }
예제 #2
0
        public AdapterContext(BleAdapterConfiguration config)
        {
            config = config ?? new BleAdapterConfiguration();
            var opts = new CBCentralInitOptions
            {
                ShowPowerAlert = config.ShowPowerAlert
            };

            if (!config.RestoreIdentifier.IsEmpty())
            {
                opts.RestoreIdentifier = config.RestoreIdentifier;
            }

            this.Manager = new CBCentralManager(this, config.DispatchQueue, opts);
        }
예제 #3
0
        public AdapterContext(BleAdapterConfiguration config)
        {
            var opts = new CBCentralInitOptions
            {
                ShowPowerAlert = config.ShowPowerAlert
            };

#if __IOS__
            if (!config.RestoreIdentifier.IsEmpty())
            {
                opts.RestoreIdentifier = config?.RestoreIdentifier;
            }
#endif
            this.Manager = new CBCentralManager(this, config?.DispatchQueue, opts);
        }
예제 #4
0
 public CentralManager(BleAdapterConfiguration config = null)
 {
     this.context = new AdapterContext(config);
 }