Skip to content

Commit

Permalink
Bluetooth LE Explorer first commit to GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen Froehlich committed Aug 15, 2017
1 parent a8e0d4f commit bb41e5c
Show file tree
Hide file tree
Showing 160 changed files with 14,144 additions and 0 deletions.
125 changes: 125 additions & 0 deletions BluetoothLEExplorer/BluetoothLEExplorer.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GattServicesLibrary", "..\GattServicesLibrary\GattServicesLibrary\GattServicesLibrary.csproj", "{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GattHelper", "GattHelper\GattHelper.csproj", "{37C63FDD-D995-4CC2-B014-4FB323194001}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SortedObservableCollection", "SortedObservableCollection", "{92EE95F6-40B6-4E5A-97C9-E4234D17C022}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SortedObservableCollection", "..\SortedObservableCollection\SortedObservableCollection\SortedObservableCollection.csproj", "{BE79FC52-6041-4913-B0D4-66C100944904}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BluetoothLEExplorer", "BluetoothLEExplorer\BluetoothLEExplorer.csproj", "{AD1CBE3C-A68A-4E02-8001-E02B815560EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BluetoothLEExplorerUnitTests", "BluetoothLEExplorerUnitTests\BluetoothLEExplorerUnitTests.csproj", "{6F503DF9-71C9-4340-90BB-D9AA14ADB686}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Debug|ARM.ActiveCfg = Debug|ARM
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Debug|ARM.Build.0 = Debug|ARM
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Debug|x64.ActiveCfg = Debug|x64
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Debug|x64.Build.0 = Debug|x64
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Debug|x86.ActiveCfg = Debug|x86
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Debug|x86.Build.0 = Debug|x86
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Release|Any CPU.Build.0 = Release|Any CPU
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Release|ARM.ActiveCfg = Release|ARM
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Release|ARM.Build.0 = Release|ARM
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Release|x64.ActiveCfg = Release|x64
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Release|x64.Build.0 = Release|x64
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Release|x86.ActiveCfg = Release|x86
{644F40AD-EABB-4570-B9B7-E3F8DDAA80F3}.Release|x86.Build.0 = Release|x86
{37C63FDD-D995-4CC2-B014-4FB323194001}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37C63FDD-D995-4CC2-B014-4FB323194001}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37C63FDD-D995-4CC2-B014-4FB323194001}.Debug|ARM.ActiveCfg = Debug|ARM
{37C63FDD-D995-4CC2-B014-4FB323194001}.Debug|ARM.Build.0 = Debug|ARM
{37C63FDD-D995-4CC2-B014-4FB323194001}.Debug|x64.ActiveCfg = Debug|x64
{37C63FDD-D995-4CC2-B014-4FB323194001}.Debug|x64.Build.0 = Debug|x64
{37C63FDD-D995-4CC2-B014-4FB323194001}.Debug|x86.ActiveCfg = Debug|x86
{37C63FDD-D995-4CC2-B014-4FB323194001}.Debug|x86.Build.0 = Debug|x86
{37C63FDD-D995-4CC2-B014-4FB323194001}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37C63FDD-D995-4CC2-B014-4FB323194001}.Release|Any CPU.Build.0 = Release|Any CPU
{37C63FDD-D995-4CC2-B014-4FB323194001}.Release|ARM.ActiveCfg = Release|ARM
{37C63FDD-D995-4CC2-B014-4FB323194001}.Release|ARM.Build.0 = Release|ARM
{37C63FDD-D995-4CC2-B014-4FB323194001}.Release|x64.ActiveCfg = Release|x64
{37C63FDD-D995-4CC2-B014-4FB323194001}.Release|x64.Build.0 = Release|x64
{37C63FDD-D995-4CC2-B014-4FB323194001}.Release|x86.ActiveCfg = Release|x86
{37C63FDD-D995-4CC2-B014-4FB323194001}.Release|x86.Build.0 = Release|x86
{BE79FC52-6041-4913-B0D4-66C100944904}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE79FC52-6041-4913-B0D4-66C100944904}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE79FC52-6041-4913-B0D4-66C100944904}.Debug|ARM.ActiveCfg = Debug|ARM
{BE79FC52-6041-4913-B0D4-66C100944904}.Debug|ARM.Build.0 = Debug|ARM
{BE79FC52-6041-4913-B0D4-66C100944904}.Debug|x64.ActiveCfg = Debug|x64
{BE79FC52-6041-4913-B0D4-66C100944904}.Debug|x64.Build.0 = Debug|x64
{BE79FC52-6041-4913-B0D4-66C100944904}.Debug|x86.ActiveCfg = Debug|x86
{BE79FC52-6041-4913-B0D4-66C100944904}.Debug|x86.Build.0 = Debug|x86
{BE79FC52-6041-4913-B0D4-66C100944904}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE79FC52-6041-4913-B0D4-66C100944904}.Release|Any CPU.Build.0 = Release|Any CPU
{BE79FC52-6041-4913-B0D4-66C100944904}.Release|ARM.ActiveCfg = Release|ARM
{BE79FC52-6041-4913-B0D4-66C100944904}.Release|ARM.Build.0 = Release|ARM
{BE79FC52-6041-4913-B0D4-66C100944904}.Release|x64.ActiveCfg = Release|x64
{BE79FC52-6041-4913-B0D4-66C100944904}.Release|x64.Build.0 = Release|x64
{BE79FC52-6041-4913-B0D4-66C100944904}.Release|x86.ActiveCfg = Release|x86
{BE79FC52-6041-4913-B0D4-66C100944904}.Release|x86.Build.0 = Release|x86
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Debug|Any CPU.ActiveCfg = Debug|x86
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Debug|ARM.ActiveCfg = Debug|ARM
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Debug|ARM.Build.0 = Debug|ARM
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Debug|ARM.Deploy.0 = Debug|ARM
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Debug|x64.ActiveCfg = Debug|x64
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Debug|x64.Build.0 = Debug|x64
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Debug|x64.Deploy.0 = Debug|x64
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Debug|x86.ActiveCfg = Debug|x86
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Debug|x86.Build.0 = Debug|x86
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Debug|x86.Deploy.0 = Debug|x86
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Release|Any CPU.ActiveCfg = Release|x86
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Release|ARM.ActiveCfg = Release|ARM
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Release|ARM.Build.0 = Release|ARM
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Release|ARM.Deploy.0 = Release|ARM
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Release|x64.ActiveCfg = Release|x64
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Release|x64.Build.0 = Release|x64
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Release|x64.Deploy.0 = Release|x64
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Release|x86.ActiveCfg = Release|x86
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Release|x86.Build.0 = Release|x86
{AD1CBE3C-A68A-4E02-8001-E02B815560EE}.Release|x86.Deploy.0 = Release|x86
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Debug|Any CPU.ActiveCfg = Debug|x86
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Debug|ARM.ActiveCfg = Debug|ARM
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Debug|ARM.Build.0 = Debug|ARM
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Debug|ARM.Deploy.0 = Debug|ARM
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Debug|x64.ActiveCfg = Debug|x64
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Debug|x64.Build.0 = Debug|x64
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Debug|x64.Deploy.0 = Debug|x64
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Debug|x86.ActiveCfg = Debug|x86
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Debug|x86.Build.0 = Debug|x86
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Debug|x86.Deploy.0 = Debug|x86
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Release|Any CPU.ActiveCfg = Release|x86
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Release|ARM.ActiveCfg = Release|ARM
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Release|ARM.Build.0 = Release|ARM
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Release|ARM.Deploy.0 = Release|ARM
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Release|x64.ActiveCfg = Release|x64
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Release|x64.Build.0 = Release|x64
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Release|x64.Deploy.0 = Release|x64
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Release|x86.ActiveCfg = Release|x86
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Release|x86.Build.0 = Release|x86
{6F503DF9-71C9-4340-90BB-D9AA14ADB686}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BE79FC52-6041-4913-B0D4-66C100944904} = {92EE95F6-40B6-4E5A-97C9-E4234D17C022}
EndGlobalSection
EndGlobal
10 changes: 10 additions & 0 deletions BluetoothLEExplorer/BluetoothLEExplorer/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<common:BootStrapper x:Class="BluetoothLEExplorer.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:common="using:Template10.Common">

<Application.Resources>
<ResourceDictionary Source="Styles\Custom.xaml" />
</Application.Resources>

</common:BootStrapper>
153 changes: 153 additions & 0 deletions BluetoothLEExplorer/BluetoothLEExplorer/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
// <copyright file="App.xaml.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//----------------------------------------------------------------------------------------------
using System;
using System.Threading.Tasks;
using BluetoothLEExplorer.Services.SettingsServices;
using Template10.Controls;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
using Windows.UI.Popups;
using BluetoothLEExplorer.Models;
using BluetoothLEExplorer.ViewModels;
using System.Diagnostics;

namespace BluetoothLEExplorer
{
//// Documentation on APIs used in this page:
//// https://github.com/Windows-XAML/Template10/wiki

/// <summary>
/// The application
/// </summary>
[Bindable]
public sealed partial class App : Template10.Common.BootStrapper
{
/// <summary>
/// Initializes a new instance of the <see cref="App" /> class.
/// </summary>
public App()
{
InitializeComponent();
this.UnhandledException += App_UnhandledException;

this.Suspending += App_Suspending;
this.Resuming += App_Resuming;

SplashFactory = (e) => new Views.Splash(e);

#region App settings

var settings = SettingsService.Instance;
RequestedTheme = settings.AppTheme;
CacheMaxDuration = settings.CacheMaxDuration;
ShowShellBackButton = settings.UseShellBackButton;

#endregion
}

private void App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
{
try
{
var deferral = e.SuspendingOperation.GetDeferral();

foreach(GenericGattServiceViewModel service in GattSampleContext.Context.CreatedServices)
{
string key = "Service_"+ service.Service.ServiceProvider.Service.Uuid.ToString() + "_IsPublishing";
bool value = service.IsPublishing;
SettingsService.Instance.SettingsDictionary[key] = value;

if (service.IsPublishing)
{
service.Service.ServiceProvider.StopAdvertising();
}
}

deferral.Complete();
}
catch(Exception ex)
{
Debug.WriteLine("Suspending: " + ex.Message);
}
}

private void App_Resuming(object sender, object e)
{
string[] keys = new string[SettingsService.Instance.SettingsDictionary.Keys.Count];

SettingsService.Instance.SettingsDictionary.Keys.CopyTo(keys, 0);

for (int i = 0; i < keys.Length; i++)
{
if (keys[i].Contains("Service_"))
{
string serviceUUID = keys[i].Split('_')[1];
bool IsPublishing = (bool)SettingsService.Instance.SettingsDictionary[keys[i]];

if (IsPublishing)
{
foreach (GenericGattServiceViewModel service in GattSampleContext.Context.CreatedServices)
{
if (serviceUUID == service.Service.ServiceProvider.Service.Uuid.ToString())
{
service.Service.Start(true);
}
}
}
}
}
}

private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
showDialog(e.Exception.Message + "\n\n" + e.Exception.StackTrace);
}

private async void showDialog(string content)
{
MessageDialog dialog = new MessageDialog(content, "Fatal Error");
await dialog.ShowAsync();
}

/// <summary>
/// Application initialization
/// </summary>
/// <param name="args"></param>
/// <returns>On initialization task</returns>
public override async Task OnInitializeAsync(IActivatedEventArgs args)
{
if (Window.Current.Content as ModalDialog == null)
{
// create a new frame
var nav = NavigationServiceFactory(BackButton.Attach, ExistingContent.Include);

// create modal root
Window.Current.Content = new ModalDialog
{
DisableBackButtonWhenModal = true,
Content = new Views.Shell(nav),
ModalContent = new Views.Busy(),
};
}

await Task.CompletedTask;
}

/// <summary>
/// App initialization for long running tasks
/// </summary>
/// <param name="startKind"></param>
/// <param name="args"></param>
/// <returns>On start task</returns>
public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
{
//// long-running startup tasks go here

NavigationService.Navigate(typeof(Views.Discover));
await Task.CompletedTask;
}
}
}
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.
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.
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

0 comments on commit bb41e5c

Please sign in to comment.