Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ObservableGattDeviceService" /> class.
 /// </summary>
 /// <param name="service">The service this class wraps</param>
 public ObservableGattDeviceService(GattDeviceService service)
 {
     Service = service;
     Name    = GattUuidsService.ConvertUuidToName(service.Uuid);
     UUID    = Service.Uuid.ToString();
     var t = GetAllCharacteristics();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ObservableGattCharacteristics"/> class.
        /// </summary>
        /// <param name="characteristic">The characteristic.</param>
        /// <param name="parent">The parent.</param>
        public ObservableGattCharacteristics(GattCharacteristic characteristic, ObservableGattDeviceService parent)
        {
            Characteristic = characteristic;
            Parent         = parent;
            Name           = GattUuidsService.ConvertUuidToName(Characteristic.Uuid);
            UUID           = Characteristic.Uuid.ToString();

#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            ReadValueAsync();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

            characteristic.ValueChanged += Characteristic_ValueChanged;
        }