Example #1
0
 public DeviceContext(CentralContext adapterContext,
                      IPeripheral peripheral,
                      BluetoothLEDevice native)
 {
     this.syncLock         = new object();
     this.connSubject      = new Subject <ConnectionState>();
     this.adapterContext   = adapterContext;
     this.subscribers      = new List <GattCharacteristic>();
     this.Peripheral       = peripheral;
     this.NativeDevice     = native;
     this.bluetoothAddress = native.BluetoothAddress;
 }
Example #2
0
 public Peripheral(CentralContext centralContext, BluetoothDevice native)
     : base(native.Name, ToDeviceId(native.Address))
 {
     this.connSubject = new Subject <ConnectionState>();
     this.context     = new DeviceContext(centralContext, native);
 }
Example #3
0
 public CentralManager(CentralContext context)
 {
     this.context = context;
 }
Example #4
0
 public CentralManager(CentralContext context)
 {
     this.scanSubject = new Subject <bool>();
     this.context     = context;
 }
Example #5
0
 public Peripheral(CentralContext context, CBPeripheral native) : base(native.Name, native.Identifier.ToGuid())
 {
     this.context = context;
     this.Native  = native;
 }
Example #6
0
 public Peripheral(CentralContext adapterContext, BluetoothLEDevice native)
 {
     this.context = new DeviceContext(adapterContext, this, native);
     this.Name    = native.Name;
     this.Uuid    = native.GetDeviceId();
 }
Example #7
0
 public CentralManager(CentralContext context, IMessageBus messageBus)
 {
     this.context    = context;
     this.messageBus = messageBus;
 }