File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Microsoft.Toolkit.Uwp.Connectivity/BluetoothLEHelper
Microsoft.Toolkit.Uwp.SampleApp Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public ObservableGattDeviceService(GattDeviceService service)
48
48
Service = service ;
49
49
Name = GattUuidsService . ConvertUuidToName ( service . Uuid ) ;
50
50
UUID = Service . Uuid . ToString ( ) ;
51
- PopulateAllCharacteristicsAsync ( ) ;
51
+ _ = PopulateAllCharacteristicsAsync ( ) ;
52
52
}
53
53
54
54
/// <summary>
@@ -149,7 +149,8 @@ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName
149
149
/// <summary>
150
150
/// Populate the characteristics in <see cref="Characteristics"/>.
151
151
/// </summary>
152
- private async void PopulateAllCharacteristicsAsync ( )
152
+ /// <returns>The status of the communication with the GATT device.</returns>
153
+ private async Task < GattCommunicationStatus > PopulateAllCharacteristicsAsync ( )
153
154
{
154
155
var tokenSource = new CancellationTokenSource ( 5000 ) ;
155
156
var getCharacteristicsTask = await Task . Run (
@@ -166,6 +167,8 @@ private async void PopulateAllCharacteristicsAsync()
166
167
Characteristics . Add ( new ObservableGattCharacteristics ( gattCharacteristic , this ) ) ;
167
168
}
168
169
}
170
+
171
+ return result . Status ;
169
172
}
170
173
}
171
174
}
Original file line number Diff line number Diff line change 6
6
using System . Collections . Generic ;
7
7
using System . Linq ;
8
8
using System . Numerics ;
9
+ using System . Threading . Tasks ;
9
10
using Microsoft . Toolkit . Uwp . SampleApp . Pages ;
10
11
using Microsoft . Toolkit . Uwp . UI . Animations ;
11
12
using Microsoft . Toolkit . Uwp . UI . Controls ;
@@ -35,11 +36,11 @@ private Sample CurrentSample
35
36
set
36
37
{
37
38
_currentSample = value ;
38
- SetNavViewSelection ( ) ;
39
+ _ = SetNavViewSelectionAsync ( ) ;
39
40
}
40
41
}
41
42
42
- private async void SetNavViewSelection ( )
43
+ private async Task SetNavViewSelectionAsync ( )
43
44
{
44
45
if ( _currentSample != null )
45
46
{
@@ -61,7 +62,7 @@ private void HideSamplePicker()
61
62
SamplePickerGrid . Visibility = Visibility . Collapsed ;
62
63
_selectedCategory = null ;
63
64
64
- SetNavViewSelection ( ) ;
65
+ _ = SetNavViewSelectionAsync ( ) ;
65
66
}
66
67
67
68
private async void ShowSamplePicker ( Sample [ ] samples = null , bool group = false )
You can’t perform that action at this time.
0 commit comments