/// <summary>
        /// Initializes a new instance of the<see cref="ObservableGattCharacteristics" /> class.
        /// </summary>
        /// <param name="characteristic">Characteristic this class wraps</param>
        /// <param name="parent">The parent service that wraps this characteristic</param>
        public ObservableGattCharacteristics(GattCharacteristic characteristic, ObservableGattDeviceService parent)
        {
            Characteristic = characteristic;
            Parent         = parent;

            Name = GattCharacteristicUuidHelper.ConvertUuidToName(characteristic.Uuid);
            UUID = characteristic.Uuid.ToString();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the<see cref="ObservableGattCharacteristics" /> class.
 /// </summary>
 /// <param name="characteristic">Characteristic this class wraps</param>
 /// <param name="parent">The parent service that wraps this characteristic</param>
 public ObservableGattCharacteristics(GattCharacteristic characteristic, ObservableGattDeviceService parent)
 {
     Characteristic = characteristic;
     Parent         = parent;
     Name           = GattCharacteristicUuidHelper.ConvertUuidToName(Characteristic.Uuid);
     UUID           = Characteristic.Uuid.ToString();
     tempString     = "";
     ReadValueAsync();
     GetAllDescriptors();
     characteristic.ValueChanged += Characteristic_ValueChanged;
     PropertyChanged             += ObservableGattCharacteristics_PropertyChanged;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the<see cref="ObservableGattCharacteristics" /> class.
        /// </summary>
        /// <param name="characteristic">Characteristic this class wraps</param>
        /// <param name="parent">The parent service that wraps this characteristic</param>
        public ObservableGattCharacteristics(GattCharacteristic characteristic, ObservableGattDeviceService parent)
        {
            Characteristic = characteristic;
            Parent         = parent;
            Name           = GattCharacteristicUuidHelper.ConvertUuidToName(characteristic.Uuid);
            var shortId = BluetoothUuidHelper.TryGetShortId(characteristic.Uuid);

            if (shortId.HasValue)
            {
                ShortUUID = "0x" + shortId.Value.ToString("X");
            }
            else
            {
                ShortUUID = "";
            }
            UUID = characteristic.Uuid.ToString();
        }