Esempio n. 1
0
        public BleContext(BleAdapterConfiguration config)
        {
            this.Manager = config == null
                ? new CBCentralManager(this, DispatchQueue.CurrentQueue)
                : new CBCentralManager(this, config.DispatchQueue, new CBCentralInitOptions
            {
                ShowPowerAlert = config.ShowPowerAlert,
#if __IOS__
                RestoreIdentifier = config.RestoreIdentifier
#endif
            });
        }
Esempio n. 2
0
        public AdapterContext(BleAdapterConfiguration config)
        {
            this.PeripheralManager = new CBPeripheralManager();
            var queue = config?.DispatchQueue ?? DispatchQueue.CurrentQueue;

            var opts = new CBCentralInitOptions
            {
                ShowPowerAlert = config?.ShowPowerAlert ?? false,
#if __IOS__
                RestoreIdentifier = config?.RestoreIdentifier ?? "acrble"
#endif
            };

            this.Manager = new CBCentralManager(this, queue, opts);
        }
Esempio n. 3
0
 /// <summary>
 /// You should call this before calling BleAdapter.Current!
 /// </summary>
 public static void Init(BleAdapterConfiguration configuration)
 {
     Current = new Adapter(configuration);
 }
Esempio n. 4
0
 public Adapter(BleAdapterConfiguration config = null)
 {
     this.context    = new AdapterContext(config);
     this.Advertiser = new Advertiser(this);
 }
Esempio n. 5
0
 public Adapter(BleAdapterConfiguration config = null)
 {
     this.context    = new AdapterContext(config);
     this.Advertiser = new Advertiser(this.context.PeripheralManager);
 }
Esempio n. 6
0
 public Adapter(BleAdapterConfiguration config = null)
 {
     this.context           = new AdapterContext(config);
     this.scanStatusChanged = new Subject <bool>();
 }
Esempio n. 7
0
 public Adapter(BleAdapterConfiguration config = null)
 {
     this.context = new AdapterContext(config);
 }