public virtual async Task Refresh( ) { Characteristics.Refresh(DescriptionToUuid.ReadOnlyDictionary); var keys = Characteristics.Characteristics.Keys.ToArray( ); foreach (var key in keys) { if (!Characteristics.Characteristics.TryGetValue(key, out var characteristic)) { Logger.Warning($"Failed to get value for key '{key}'"); continue; } if (characteristic == null) { Logger.Warning($"Failed, characteristic for key '{key}' is null"); continue; } Logger.Debug($"Reading raw value for {key} " + $"and and characteristic {characteristic.Uuid}"); (bool success, byte [] value)result = await RawValueReader.TryReadValueAsync(characteristic); RawValues [key] = result.success ? result.value : RawArrayEmpty; } }