/// <summary>
 /// Will discover all services/characteristics/descriptors when connected state occurs
 /// </summary>
 /// <param name="peripheral"></param>
 /// <returns></returns>
 public static IObservable <IList <IGattDescriptor> > GetAllDescriptors(this IPeripheral peripheral) =>
 peripheral
 .GetAllCharacteristics()
 .SelectMany(x => x.Select(y => y.GetDescriptors()))
 .Switch();
Exemple #2
0
 public static Task <IList <IGattCharacteristic> > GetAllCharacteristicsAsync(this IPeripheral peripheral, CancellationToken?cancelToken = null)
 => peripheral
 .GetAllCharacteristics()
 .ToTask(cancelToken ?? CancellationToken.None);
Exemple #3
0
 public static Task <IList <IGattCharacteristic> > GetAllCharacteristicsAsync(this IPeripheral peripheral, CancellationToken cancelToken = default)
 => peripheral
 .GetAllCharacteristics()
 .ToTask(cancelToken);