public BeaconScanner()
        {
            Init();

            managerDelegate         = new CentralManagerDelegate(this);
            centralManager          = new CBCentralManager(managerDelegate, beaconOperationsQueue);
            centralManager.Delegate = managerDelegate;
        }
Exemplo n.º 2
0
 internal Peripheral(
     CBCentralManager central,
     CentralManagerDelegate centralDelegate,
     CBPeripheral peripheral)
 {
     this.central         = central;
     this.centralDelegate = centralDelegate;
     @delegate            = new PeripheralDelegate();
     this.peripheral      = peripheral;
     peripheral.Delegate  = @delegate;
 }
Exemplo n.º 3
0
        private CentralManager()
        {
            @delegate = new CentralManagerDelegate();
            central   = new CBCentralManager(@delegate, new DispatchQueue("Dandy.Devices.BLE.Mac.CentralManager"));
            var isScanningSubject = new BehaviorSubject <bool>(central.IsScanning);

            isScanningObserver = central.AddObserver("isScanning", NSKeyValueObservingOptions.New, change => {
                var value = ((NSNumber)change.NewValue).BoolValue;
                isScanningSubject.OnNext(value);
            });
            isScanningObservable = isScanningSubject.AsObservable();
        }