/// <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(); }
/// <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; }
/// <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(); }