Beispiel #1
0
        public Device(BleContext context, BluetoothLEDevice native)
        {
            this.context = context;
            this.native  = native;

            var mac = this.ToMacAddress(native.BluetoothAddress);

            this.Uuid = this.GetDeviceId(mac);
            //this.Uuid = this.GetDeviceId(native.DeviceId);
        }
Beispiel #2
0
        public Device(BleContext context, BluetoothLEDevice native)
        {
            this.connSubject = new Subject <ConnectionStatus>();
            this.context     = context;
            this.native      = native;

            var mac = this.ToMacAddress(native.BluetoothAddress);

            this.Uuid = this.GetDeviceId(mac);
            //this.Uuid = this.GetDeviceId(native.DeviceId);
        }
Beispiel #3
0
        public Adapter()
        {
            this.scanStatusSubject = new Subject <bool>();
            this.context           = new BleContext();


            this.radio = new Lazy <Radio>(() =>
                                          Radio
                                          .GetRadiosAsync()
                                          .AsTask()
                                          .Result
                                          .FirstOrDefault(x => x.Kind == RadioKind.Bluetooth)
                                          );
        }
Beispiel #4
0
 public Device(BleContext context, CBPeripheral peripheral) : base(peripheral.Name, peripheral.Identifier.ToGuid())
 {
     this.context    = context;
     this.peripheral = peripheral;
 }
Beispiel #5
0
 public Adapter()
 {
     this.manager           = (BluetoothManager)Application.Context.GetSystemService(Application.BluetoothService);
     this.context           = new BleContext(this.manager);
     this.scanStatusChanged = new Subject <bool>();
 }
Beispiel #6
0
 public Adapter(BleAdapterConfiguration config = null)
 {
     this.context           = new BleContext(config);
     this.scanStatusChanged = new Subject <bool>();
 }