Пример #1
0
 public Descriptor(CBDescriptor nativeDescriptor, CBPeripheral parentDevice, ICharacteristic characteristic, CBCentralManager centralManager)
     : base(characteristic)
 {
     _parentDevice     = parentDevice;
     _nativeDescriptor = nativeDescriptor;
     _centralManager   = centralManager;
 }
        public Descriptor(CBDescriptor nativeDescriptor, CBPeripheral parentDevice, Characteristic characteristic, IBleCentralManagerDelegate bleCentralManagerDelegate) : this(characteristic)
        {
            NativeDescriptor = nativeDescriptor;

            _parentDevice = parentDevice;
            _bleCentralManagerDelegate = bleCentralManagerDelegate;
        }
Пример #3
0
 private Descriptor ConvertDescriptor(CBDescriptor nativeDescriptor)
 {
     return(new Descriptor
     {
         Id = BluetoothConverter.ConvertBluetoothLeUuid(nativeDescriptor.UUID.Uuid),
         NativeDescriptor = nativeDescriptor
     });
 }
Пример #4
0
        internal BLEDescriptor(BLECBPeripheralWrapper peripheral, CBDescriptor descriptor)
        {
            _peripheralReference = new WeakReference(peripheral);
            _descriptor          = descriptor;

            PeripheralWrapper.UpdatedValue         += OnUpdatedValue;
            PeripheralWrapper.WroteDescriptorValue += OnWroteDescriptorValue;
        }
Пример #5
0
 internal GattDescriptor(
     CBPeripheral peripheral,
     PeripheralDelegate @delegate,
     GattCharacteristic characteristic,
     CBDescriptor descriptor)
 {
     this.peripheral = peripheral;
     this.@delegate  = @delegate;
     Characteristic  = characteristic;
     this.descriptor = descriptor;
 }
Пример #6
0
        bool Equals(CBDescriptor descriptor)
        {
            if (!this.native.UUID.Equals(descriptor.UUID))
            {
                return(false);
            }

            if (!this.NativeCharacteristic.UUID.Equals(descriptor.Characteristic.UUID))
            {
                return(false);
            }

            if (!this.NativeService.UUID.Equals(descriptor.Characteristic.Service.UUID))
            {
                return(false);
            }

            if (!this.Peripheral.Identifier.Equals(descriptor.Characteristic.Service.Peripheral.Identifier))
            {
                return(false);
            }

            return(true);
        }
Пример #7
0
 public Descriptor(CBDescriptor nativeDescriptor, CBPeripheral parentDevice)
 {
     _parentDevice = parentDevice;
     _nativeDescriptor = nativeDescriptor;
 }
 public override void UpdatedValue(CBPeripheral peripheral, CBDescriptor descriptor, NSError error)
 {
     Console.WriteLine ("Value of characteristic " + descriptor.Characteristic + " is " + descriptor.Value);
 }
Пример #9
0
 public GattDescriptor(GattCharacteristic characteristic, CBDescriptor native) : base(characteristic, native.UUID.ToGuid())
 {
     this.characteristicObj = characteristic;
     this.native            = native;
 }
Пример #10
0
 internal GattDescriptor(GattCharacteristic characteristic, CBDescriptor descriptor) : this(characteristic)
 {
     _descriptor = descriptor;
 }
Пример #11
0
 public Descriptor(CBDescriptor nativeDescriptor)
 {
     this._nativeDescriptor = nativeDescriptor;
 }
Пример #12
0
 public Descriptor(CBDescriptor nativeDescriptor)
 {
     _nativeDescriptor = nativeDescriptor;
 }
Пример #13
0
		public Descriptor (CBDescriptor nativeDescriptor)
		{
			this._nativeDescriptor = nativeDescriptor;
		}
Пример #14
0
 public Descriptor(CBDescriptor nativeDescriptor)
 {
     _nativeDescriptor = nativeDescriptor;
 }
Пример #15
0
 private GattDescriptor(CBDescriptor descriptor)
 {
     _descriptor = descriptor;
 }
 public Descriptor(CBDescriptor nativeDescriptor, CBPeripheral parentDevice)
 {
     _parentDevice     = parentDevice;
     _nativeDescriptor = nativeDescriptor;
 }
 public override void UpdatedValue(CBPeripheral peripheral, CBDescriptor descriptor, NSError error)
 {
     base.UpdatedValue(peripheral, descriptor, error);
 }
Пример #18
0
 public Descriptor(CBDescriptor nativeDescriptor, CBPeripheral parentDevice, ICharacteristic characteristic) : base(characteristic)
 {
     _parentDevice     = parentDevice;
     _nativeDescriptor = nativeDescriptor;
 }
Пример #19
0
 public static byte[] ToByteArray(this CBDescriptor native) => (native.Value as NSData)?.ToArray();
Пример #20
0
 public override void UpdatedValue(CBPeripheral peripheral, CBDescriptor descriptor, NSError error)
 {
     Console.WriteLine("Value of characteristic " + descriptor.Characteristic + " is " + descriptor.Value);
 }