Пример #1
0
        public Descriptor(BluetoothGattDescriptor nativeDescriptor, BluetoothGatt gatt, IGattCallback gattCallback)
        {
            _gattCallback = gattCallback;
            _gatt = gatt;

            _nativeDescriptor = nativeDescriptor;
        }
 private void OnDescriptorWritten(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, GattStatus status)
 {
     if (status == GattStatus.Success && _onSubscribed != null)
     {
         _onSubscribed(true);
     }
 }
Пример #3
0
		public override void OnDescriptorRead (BluetoothGatt gatt, BluetoothGattDescriptor descriptor, GattStatus status)
		{
			base.OnDescriptorRead (gatt, descriptor, status);

			Console.WriteLine ("OnDescriptorRead: " + descriptor.ToString());

		}
Пример #4
0
 public override void OnDescriptorRead(ABluetooth.BluetoothGatt gatt, ABluetooth.BluetoothGattDescriptor descriptor, ABluetooth.GattStatus status)
 {
     System.Diagnostics.Debug.WriteLine($"DescriptorRead {descriptor.Uuid} {status}");
     _owner.DescriptorRead?.Invoke(_owner, new DescriptorEventArgs {
         Descriptor = descriptor, Status = status
     });
 }
Пример #5
0
		public override void OnDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, GattStatus status)
		{
			base.OnDescriptorWrite(gatt, descriptor, status);

			Console.WriteLine("GattCallBack: OnDescriptorWrite: " + descriptor.ToString());
			this.DescriptorWrite(this, new CharacteristicReadEventArgs() 
			{ 
				Characteristic = new Characteristic(descriptor.Characteristic, gatt, this) 
			});
		}
Пример #6
0
 internal GattDescriptor(GattCharacteristic characteristic, ABluetooth.BluetoothGattDescriptor descriptor) : this(characteristic)
 {
     _descriptor = descriptor;
 }
 public override void OnDescriptorRead(ABluetooth.BluetoothGatt gatt, ABluetooth.BluetoothGattDescriptor descriptor, ABluetooth.GattStatus status)
 {
     System.Diagnostics.Debug.WriteLine($"DescriptorRead {descriptor.Uuid} {status}");
     _owner._descriptorReadHandle.Set();
 }
 public override void OnDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, GattStatus status)
 {
     var handler = DescriptorWritten;
     if (handler != null) handler(gatt, descriptor, status);
 }
Пример #9
0
 public GattServerDescriptor(Guid uuid, GattPermissions permissions)
 {
     DroidDescriptor = new Android.Bluetooth.BluetoothGattDescriptor(uuid.ToJavaUuid(), permissions.ToDroidGattDescriptorPermission());
 }
Пример #10
0
		public Descriptor (BluetoothGattDescriptor nativeDescriptor)
		{
			this._nativeDescriptor = nativeDescriptor;
		}
Пример #11
0
        public override void OnDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, GattStatus status)
        {
            base.OnDescriptorRead(gatt, descriptor, status);

            Mvx.Trace("OnDescriptorRead: " + descriptor.ToString());

        }
Пример #12
0
        public override void OnDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, GattStatus status)
        {
            base.OnDescriptorRead(gatt, descriptor, status);

            Trace.Message("OnDescriptorRead: {0}", descriptor.GetValue()?.ToHexString());

            DescriptorValueRead?.Invoke(this, new DescriptorCallbackEventArgs(descriptor, GetExceptionFromGattStatus(status)));
        }
 public DescriptorCallbackEventArgs(BluetoothGattDescriptor descriptor, Exception exception = null)
 {
     Descriptor = descriptor;
     Exception = exception;
 }