Concrete implmentation of BluetoothLE.Core.ICharacteristic interface
Inheritance: ICharacteristic
Example #1
0
		/// <summary>
		/// Discovers the characteristics for the services.
		/// </summary>
		public void DiscoverCharacteristics()
		{
			// do nothing
			foreach (var c in _nativeService.Characteristics)
			{
				var characteristic = new Characteristic(c, _gatt, _callback);
				Characteristics.Add(characteristic);

				CharacteristicDiscovered(this, new CharacteristicDiscoveredEventArgs(characteristic));
			}
		}
		/// <summary>
		/// Raises the characteristic read event.
		/// </summary>
		/// <param name="gatt">Gatt.</param>
		/// <param name="characteristic">Characteristic.</param>
		/// <param name="status">Status.</param>
		public override void OnCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, GattStatus status)
		{
			base.OnCharacteristicRead(gatt, characteristic, status);

			if (status != GattStatus.Success)
				return;

			var iChar = new Characteristic(characteristic, gatt, this);
			CharacteristicValueUpdated(this, new CharacteristicReadEventArgs(iChar));
		}
		/// <Docs>GATT client the characteristic is associated with</Docs>
		/// <summary>
		/// Callback triggered as a result of a remote characteristic notification.
		/// </summary>
		/// <para tool="javadoc-to-mdoc">Callback triggered as a result of a remote characteristic notification.</para>
		/// <format type="text/html">[Android Documentation]</format>
		/// <since version="Added in API level 18"></since>
		/// <param name="gatt">Gatt.</param>
		/// <param name="characteristic">Characteristic.</param>
		public override void OnCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic)
		{
			base.OnCharacteristicChanged(gatt, characteristic);

			var iChar = new Characteristic(characteristic, gatt, this);
			CharacteristicValueUpdated(this, new CharacteristicReadEventArgs(iChar));
		}