-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1291 from Microsoft/dev
Merging dev to master for 1.5
- Loading branch information
Showing
252 changed files
with
17,835 additions
and
1,190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/BluetoothLEHelper/BluetoothLEHelperCode.bind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Get a local copy of the context for easier reading | ||
BluetoothLEHelper bluetoothLEHelper = BluetoothLEHelper.Context; | ||
|
||
// check if BluetoothLE APIs are available | ||
if (BluetoothLEHelper.IsBluetoothLESupported) | ||
{ | ||
// Start the Enumeration | ||
bluetoothLEHelper.StartEnumeration(); | ||
|
||
// At this point the user needs to select a device they want to connect to. This can be done by | ||
// creating a ListView and binding the bluetoothLEHelper collection to it. Once a device is found, | ||
// the Connect() method can be called to connect to the device and start interacting with its services | ||
|
||
// Connect to a device if your choice | ||
ObservableBluetoothLEDevice device = bluetoothLEHelper.BluetoothLeDevices[<Device you choose>]; | ||
await device.ConnectAsync(); | ||
|
||
// At this point the device is connected and the Services property is populated. | ||
|
||
// See all the services | ||
var services = device.Services; | ||
} |
62 changes: 62 additions & 0 deletions
62
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/BluetoothLEHelper/BluetoothLEHelperPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<Page | ||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.BluetoothLEHelperPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:bt="using:Microsoft.Toolkit.Uwp" | ||
mc:Ignorable="d"> | ||
|
||
<Grid Background="{StaticResource Brush-Grey-05}"> | ||
<RelativePanel x:Name="MainContent" Visibility="Collapsed" > | ||
<Button x:Name="BtEnumeration" Click="Enumeration_Click" Content="Start enumeration" Margin="10"/> | ||
<ListView x:Name="LVDevices" Height="200" VerticalAlignment="Top" Margin="10" ItemsSource="{x:Bind bluetoothLEHelper.BluetoothLeDevices}" Background="White" SelectionChanged="LVDevices_SelectionChanged" RelativePanel.Below="BtEnumeration" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate x:DataType="bt:ObservableBluetoothLEDevice"> | ||
<StackPanel> | ||
<TextBlock Text="{x:Bind Name, Mode=OneWay}"></TextBlock> | ||
</StackPanel> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
<StackPanel Name="SPDevice" Margin="10" RelativePanel.Below="LVDevices"> | ||
<TextBlock x:Name="TbDeviceName" Text="" /> | ||
<TextBlock x:Name="TbDeviceBtAddr" Text="" /> | ||
</StackPanel> | ||
|
||
<ComboBox x:Name="CBServices" Margin="10" SelectionChanged="CBServices_SelectionChanged" RelativePanel.Below="SPDevice" Visibility="Collapsed"> | ||
<ComboBox.ItemTemplate> | ||
<DataTemplate x:DataType="bt:ObservableGattDeviceService" > | ||
<TextBlock > | ||
<Run Text="Service Name: " /> | ||
<Run Text="{x:Bind Name}" /> | ||
</TextBlock> | ||
</DataTemplate> | ||
</ComboBox.ItemTemplate> | ||
</ComboBox> | ||
|
||
<ComboBox x:Name="CBCharacteristic" Margin="10" SelectionChanged="CBCharacteristic_SelectionChanged" RelativePanel.Below="CBServices" Visibility="Collapsed"> | ||
<ComboBox.ItemTemplate> | ||
<DataTemplate x:DataType="bt:ObservableGattCharacteristics" > | ||
<TextBlock > | ||
<Run Text="Characteristic Name: " /> | ||
<Run Text="{x:Bind Name}" /> | ||
</TextBlock> | ||
</DataTemplate> | ||
</ComboBox.ItemTemplate> | ||
</ComboBox> | ||
|
||
<Button x:Name="BtReadCharValue" Margin="10" Click="ReadCharValue_Click" Content="Read Value" RelativePanel.Below="CBCharacteristic" Visibility="Collapsed"/> | ||
|
||
<TextBlock x:Name="TBCharValue" Margin="10" RelativePanel.Below="BtReadCharValue"/> | ||
|
||
</RelativePanel> | ||
<TextBlock x:Name="NotAvailableMessage" Text="BluetoothLE requires the Windows 10 Creators Update" | ||
VerticalAlignment="Center" HorizontalAlignment="Center" | ||
Foreground="{ThemeResource SystemControlForegroundAccentBrush}" | ||
FontSize="20" | ||
TextWrapping="WrapWholeWords" | ||
TextAlignment="Center" Margin="40" | ||
Visibility="Collapsed"></TextBlock> | ||
</Grid> | ||
</Page> |
Oops, something went wrong.