├── src
├── .nuget
│ ├── NuGet.exe
│ └── NuGet.Config
├── Samples
│ ├── P3bble
│ │ ├── Assets
│ │ │ ├── Logo.png
│ │ │ ├── BadgeLogo.png
│ │ │ ├── StoreLogo.png
│ │ │ ├── WideLogo.png
│ │ │ ├── SplashScreen.png
│ │ │ ├── AlignmentGrid.png
│ │ │ ├── ApplicationIcon.png
│ │ │ ├── SquareTile150x150.png
│ │ │ ├── SquareTile71x71.png
│ │ │ └── Tiles
│ │ │ │ ├── IconicTileSmall.png
│ │ │ │ ├── FlipCycleTileLarge.png
│ │ │ │ ├── FlipCycleTileSmall.png
│ │ │ │ ├── FlipCycleTileMedium.png
│ │ │ │ └── IconicTileMediumLarge.png
│ │ ├── Properties
│ │ │ ├── AppManifest.xml
│ │ │ ├── AssemblyInfo.cs
│ │ │ └── WMAppManifest.xml
│ │ ├── packages.config
│ │ ├── LocalizedStrings.cs
│ │ ├── App.xaml
│ │ ├── XNAFrameworkDispatcherService.cs
│ │ ├── Package.appxmanifest
│ │ ├── MainPage.xaml
│ │ └── Resources
│ │ │ ├── AppResources.Designer.cs
│ │ │ └── AppResources.resx
│ ├── P3bble-S8.1
│ │ ├── Assets
│ │ │ ├── Logo.png
│ │ │ ├── BadgeLogo.png
│ │ │ ├── StoreLogo.png
│ │ │ ├── WideLogo.png
│ │ │ ├── SplashScreen.png
│ │ │ ├── AlignmentGrid.png
│ │ │ ├── ApplicationIcon.png
│ │ │ ├── SquareTile150x150.png
│ │ │ ├── SquareTile71x71.png
│ │ │ └── Tiles
│ │ │ │ ├── IconicTileSmall.png
│ │ │ │ ├── FlipCycleTileLarge.png
│ │ │ │ ├── FlipCycleTileSmall.png
│ │ │ │ ├── FlipCycleTileMedium.png
│ │ │ │ └── IconicTileMediumLarge.png
│ │ ├── Properties
│ │ │ ├── AppManifest.xml
│ │ │ ├── AssemblyInfo.cs
│ │ │ └── WMAppManifest.xml
│ │ ├── packages.config
│ │ ├── LocalizedStrings.cs
│ │ ├── App.xaml
│ │ ├── XNAFrameworkDispatcherService.cs
│ │ ├── Package.appxmanifest
│ │ ├── MainPage.xaml
│ │ └── Resources
│ │ │ ├── AppResources.Designer.cs
│ │ │ └── AppResources.resx
│ ├── P3bbleWinRT
│ │ ├── Assets
│ │ │ ├── Logo.png
│ │ │ ├── SmallLogo.png
│ │ │ ├── StoreLogo.png
│ │ │ └── SplashScreen.png
│ │ ├── P3bbleWinRT_TemporaryKey.pfx
│ │ ├── packages.config
│ │ ├── App.xaml
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Package.appxmanifest
│ │ ├── MainPage.xaml
│ │ ├── App.xaml.cs
│ │ ├── P3bbleWinRT.sln
│ │ └── MessageBox.cs
│ └── P3bble-8.1
│ │ ├── Assets
│ │ ├── Logo.scale-240.png
│ │ ├── WideLogo.scale-240.png
│ │ ├── SmallLogo.scale-240.png
│ │ ├── StoreLogo.scale-240.png
│ │ ├── SplashScreen.scale-240.png
│ │ └── Square71x71Logo.scale-240.png
│ │ ├── App.xaml
│ │ ├── MessageBox.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── Package.appxmanifest
│ │ ├── MainPage.xaml
│ │ └── App.xaml.cs
├── packages
│ └── repositories.config
├── P3bble.Core
│ ├── Constants
│ │ ├── MusicControls.cs
│ │ ├── SessionCaps.cs
│ │ ├── HardwareRevision.cs
│ │ ├── RemoteCaps.cs
│ │ └── Endpoint.cs
│ ├── packages.config
│ ├── Exceptions
│ │ ├── NotConnectedException.cs
│ │ ├── CannotInstallException.cs
│ │ └── ProtocolException.cs
│ ├── Messages
│ │ ├── ResetMessage.cs
│ │ ├── PingMessage.cs
│ │ ├── PhoneVersionMessage.cs
│ │ ├── VersionMessage.cs
│ │ ├── NotificationMessage.cs
│ │ ├── TimeMessage.cs
│ │ ├── MusicMessage.cs
│ │ ├── SystemMessage.cs
│ │ ├── PhoneControlMessage.cs
│ │ ├── LogsMessage.cs
│ │ ├── P3bbleMessage.cs
│ │ └── AppMessage.cs
│ ├── Types
│ │ ├── MusicControlAction.cs
│ │ ├── FirmwareResponse.cs
│ │ ├── InstalledApplication.cs
│ │ ├── ResourcesManifest.cs
│ │ ├── InstalledApplications.cs
│ │ ├── BundleManifest.cs
│ │ ├── FirmwareRelease.cs
│ │ ├── ApplicationManifest.cs
│ │ ├── FirmwareManifest.cs
│ │ ├── FirmwareVersion.cs
│ │ ├── ApplicationMetadata.cs
│ │ └── VersionInfo.cs
│ ├── Helper
│ │ ├── ByteHelper.cs
│ │ └── Util.cs
│ ├── AsyncLock.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Logger.cs
├── P3bble.Core-8.1
│ ├── packages.config
│ ├── Logger.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── P3bble.Core-S8.1
│ ├── packages.config
│ └── Properties
│ │ └── AssemblyInfo.cs
├── P3bbleWinRT.Core
│ ├── packages.config
│ ├── Logger.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── P3bble.PCL
│ ├── Logger
│ │ └── BaseLogger.cs
│ ├── ServiceLocator.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── P3bble.PCL.csproj
├── Settings.StyleCop
├── P3bble-S8.1.sln
├── P3bbleWinRT.sln
├── P3bble.sln
└── P3bble-8.1.sln
├── .gitattributes
├── NuGet
├── P3bble.PCL.nuspec
├── P3bble.nuspec
└── Package.ps1
├── .gitignore
├── LICENSE.txt
└── README.md
/src/.nuget/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/.nuget/NuGet.exe
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/Logo.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/Logo.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/BadgeLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/BadgeLogo.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/WideLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/WideLogo.png
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/Assets/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bbleWinRT/Assets/Logo.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/SplashScreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/SplashScreen.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/BadgeLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/BadgeLogo.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/WideLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/WideLogo.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/AlignmentGrid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/AlignmentGrid.png
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/Assets/SmallLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bbleWinRT/Assets/SmallLogo.png
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bbleWinRT/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/SplashScreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/SplashScreen.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/ApplicationIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/ApplicationIcon.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/SquareTile150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/SquareTile150x150.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/SquareTile71x71.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/SquareTile71x71.png
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/Assets/SplashScreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bbleWinRT/Assets/SplashScreen.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/Assets/Logo.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-8.1/Assets/Logo.scale-240.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/AlignmentGrid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/AlignmentGrid.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/Assets/WideLogo.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-8.1/Assets/WideLogo.scale-240.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/ApplicationIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/ApplicationIcon.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/SquareTile150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/SquareTile150x150.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/SquareTile71x71.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/SquareTile71x71.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/Tiles/IconicTileSmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/Tiles/IconicTileSmall.png
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/P3bbleWinRT_TemporaryKey.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bbleWinRT/P3bbleWinRT_TemporaryKey.pfx
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/Assets/SmallLogo.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-8.1/Assets/SmallLogo.scale-240.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/Assets/StoreLogo.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-8.1/Assets/StoreLogo.scale-240.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/Tiles/FlipCycleTileLarge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/Tiles/FlipCycleTileLarge.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/Tiles/FlipCycleTileSmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/Tiles/FlipCycleTileSmall.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/Assets/SplashScreen.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-8.1/Assets/SplashScreen.scale-240.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/Tiles/IconicTileSmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/Tiles/IconicTileSmall.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/Tiles/FlipCycleTileMedium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/Tiles/FlipCycleTileMedium.png
--------------------------------------------------------------------------------
/src/Samples/P3bble/Assets/Tiles/IconicTileMediumLarge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble/Assets/Tiles/IconicTileMediumLarge.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/Assets/Square71x71Logo.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-8.1/Assets/Square71x71Logo.scale-240.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/Tiles/FlipCycleTileLarge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/Tiles/FlipCycleTileLarge.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/Tiles/FlipCycleTileSmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/Tiles/FlipCycleTileSmall.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/Tiles/FlipCycleTileMedium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/Tiles/FlipCycleTileMedium.png
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Assets/Tiles/IconicTileMediumLarge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/p3root/P3bble/HEAD/src/Samples/P3bble-S8.1/Assets/Tiles/IconicTileMediumLarge.png
--------------------------------------------------------------------------------
/src/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Samples/P3bble/Properties/AppManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Properties/AppManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Samples/P3bble/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Constants/MusicControls.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace P3bble.Core.Constants
8 | {
9 | public enum MusicControls
10 | {
11 | PlayPause = 1,
12 | Forward = 4,
13 | Previous = 5,
14 | // PlayPause also sends 8 for some reason. To be figured out.
15 | Other = 8
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Samples/P3bble/LocalizedStrings.cs:
--------------------------------------------------------------------------------
1 | using P3bble.Resources;
2 |
3 | namespace P3bble
4 | {
5 | ///
6 | /// Provides access to string resources.
7 | ///
8 | public class LocalizedStrings
9 | {
10 | private static AppResources _localizedResources = new AppResources();
11 |
12 | public AppResources LocalizedResources { get { return _localizedResources; } }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/LocalizedStrings.cs:
--------------------------------------------------------------------------------
1 | using P3bble.Resources;
2 |
3 | namespace P3bble
4 | {
5 | ///
6 | /// Provides access to string resources.
7 | ///
8 | public class LocalizedStrings
9 | {
10 | private static AppResources _localizedResources = new AppResources();
11 |
12 | public AppResources LocalizedResources { get { return _localizedResources; } }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/P3bble.Core/Constants/SessionCaps.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace P3bble.Constants
8 | {
9 | ///
10 | /// Session capabilities
11 | ///
12 | internal enum SessionCaps : uint
13 | {
14 | ///
15 | /// Gamma ray
16 | ///
17 | GammaRay = 0x80000000
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/P3bble.Core/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/P3bble.Core-8.1/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/P3bble.Core-S8.1/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/P3bbleWinRT.Core/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/MessageBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Windows.UI.Popups;
7 |
8 | namespace P3bble
9 | {
10 | public static class MessageBox
11 | {
12 | public static async void Show(string message)
13 | {
14 | MessageDialog messageDialog = new MessageDialog(message);
15 | await messageDialog.ShowAsync();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Exceptions/NotConnectedException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace P3bble
4 | {
5 | ///
6 | /// Raised when calling a method on an unconnected Pebble
7 | ///
8 | public class NotConnectedException : Exception
9 | {
10 | ///
11 | /// Initializes a new instance of the class.
12 | ///
13 | public NotConnectedException()
14 | : base("You first need to connect to the Pebble")
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/ResetMessage.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using P3bble.Constants;
3 |
4 | namespace P3bble.Messages
5 | {
6 | internal class ResetMessage : P3bbleMessage
7 | {
8 | public ResetMessage()
9 | : base(Endpoint.Reset)
10 | {
11 | }
12 |
13 | protected override void AddContentToMessage(List payload)
14 | {
15 | payload.Add(0x00);
16 | }
17 |
18 | protected override void GetContentFromMessage(List payload)
19 | {
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/P3bbleWinRT.Core/Logger.cs:
--------------------------------------------------------------------------------
1 | using P3bble.PCL;
2 | using P3bble.PCL.Logger;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Diagnostics;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace P3bble
11 | {
12 | public class Logger : BaseLogger
13 | {
14 | public override void WriteLine(string message)
15 | {
16 | Debug.WriteLine(message);
17 | }
18 |
19 | public override void ClearUp()
20 | {
21 | // throw new NotImplementedException();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Exceptions/CannotInstallException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace P3bble
4 | {
5 | ///
6 | /// Raised when trying to install an app when there is no space
7 | ///
8 | public class CannotInstallException : Exception
9 | {
10 | ///
11 | /// Initializes a new instance of the class.
12 | ///
13 | /// The message that describes the error.
14 | public CannotInstallException(string message)
15 | : base(message)
16 | {
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/P3bble.PCL/Logger/BaseLogger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace P3bble.PCL.Logger
7 | {
8 | public class BaseLogger
9 | {
10 |
11 | public virtual void WriteLine(string message) { }
12 | public virtual void ClearUp() { }
13 |
14 | ///
15 | /// Gets or sets a value indicating whether logging is enabled.
16 | ///
17 | ///
18 | /// true if logging is enabled; otherwise, false.
19 | ///
20 | public bool IsEnabled { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/MusicControlAction.cs:
--------------------------------------------------------------------------------
1 | namespace P3bble.Types
2 | {
3 | ///
4 | /// The music control action
5 | ///
6 | public enum MusicControlAction : byte
7 | {
8 | ///
9 | /// Unknown state
10 | ///
11 | Unknown = 0,
12 |
13 | ///
14 | /// Play or Pause
15 | ///
16 | PlayPause = 1,
17 |
18 | ///
19 | /// Skip next
20 | ///
21 | Next = 4,
22 |
23 | ///
24 | /// Skip previous
25 | ///
26 | Previous = 5
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/P3bble.PCL/ServiceLocator.cs:
--------------------------------------------------------------------------------
1 | using P3bble.PCL.Logger;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace P3bble.PCL
9 | {
10 | public class ServiceLocator
11 | {
12 | private static BaseLogger _logger;
13 | public static BaseLogger Logger
14 | {
15 | get
16 | {
17 | if (_logger == null)
18 | _logger = new BaseLogger();
19 | return _logger;
20 |
21 | }
22 | set
23 | {
24 | _logger = value;
25 | }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Helper/ByteHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace P3bble.Helper
8 | {
9 | internal class ByteHelper
10 | {
11 | public static byte[] ConvertToByteArray(int value)
12 | {
13 | return BitConverter.GetBytes(value);
14 | }
15 |
16 | public static byte[] ConvertToByteArray(uint value)
17 | {
18 | return BitConverter.GetBytes(value);
19 | }
20 |
21 | public static byte[] ConvertToByteArray(ushort value)
22 | {
23 | return BitConverter.GetBytes(value);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Exceptions/ProtocolException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using P3bble.Messages;
3 |
4 | namespace P3bble
5 | {
6 | ///
7 | /// Raised when there's a protocol error
8 | ///
9 | public class ProtocolException : Exception
10 | {
11 | ///
12 | /// Initializes a new instance of the class.
13 | ///
14 | /// The log message.
15 | internal ProtocolException(LogsMessage logMessage)
16 | : base(logMessage.Message)
17 | {
18 | this.LogMessage = logMessage;
19 | }
20 |
21 | internal LogsMessage LogMessage { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/P3bble.Core-8.1/Logger.cs:
--------------------------------------------------------------------------------
1 | using P3bble.PCL.Logger;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Diagnostics;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace P3bble.Core
10 | {
11 | ///
12 | public class Logger : BaseLogger
13 | {
14 | private string FileName { get; set; }
15 |
16 | ///
17 | /// Writes a line to the debug log.
18 | ///
19 | /// The message.
20 | public override void WriteLine(string message)
21 | {
22 | Debug.WriteLine(message);
23 | }
24 |
25 | ///
26 | /// Clears up the current log file.
27 | ///
28 | public override void ClearUp()
29 | {
30 |
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/NuGet/P3bble.PCL.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | P3bble.PCL
5 | 1.0.1.0
6 | P3bble
7 | Patrik Pfaffenbauer
8 | Patrik Pfaffenbauer
9 | https://raw.githubusercontent.com/p3root/P3bble/master/LICENSE.txt
10 | https://github.com/p3root/P3bble
11 | false
12 | P3bble.PCL is needed to use P3bble library.
13 | P3bble.PCL is needed to use P3bble library.
14 | en-US
15 | Copyright (c) 2013-2014 Patrik Pfaffenbauer
16 | Pebble WindowsPhone wp8 wp8.1
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Constants/HardwareRevision.cs:
--------------------------------------------------------------------------------
1 | namespace P3bble.Types
2 | {
3 | ///
4 | /// Represents Pebble Hardware
5 | ///
6 | public enum HardwareRevision
7 | {
8 | ///
9 | /// The ev1 revision
10 | ///
11 | ev1 = 1,
12 |
13 | ///
14 | /// The ev2 revision
15 | ///
16 | ev2 = 2,
17 |
18 | ///
19 | /// The ev2_3 revision
20 | ///
21 | ev2_3 = 3,
22 |
23 | ///
24 | /// The ev2_4 revision
25 | ///
26 | ev2_4 = 4,
27 |
28 | ///
29 | /// The BB2 revision
30 | ///
31 | bb2 = 5,
32 |
33 | ///
34 | /// The bigboard revision
35 | ///
36 | bigboard = 6
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/FirmwareResponse.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 | using P3bble.Helper;
4 |
5 | namespace P3bble.Types
6 | {
7 | ///
8 | /// Represents firmware information from the cloud
9 | ///
10 | [DataContract]
11 | public class FirmwareResponse
12 | {
13 | ///
14 | /// Gets the recovery firmware version.
15 | ///
16 | ///
17 | /// The recovery firmware version.
18 | ///
19 | [DataMember(Name = "recovery")]
20 | public FirmwareRelease RecoveryFirmwareVersion { get; private set; }
21 |
22 | ///
23 | /// Gets the firmware version.
24 | ///
25 | ///
26 | /// The firmware version.
27 | ///
28 | [DataMember(Name = "normal")]
29 | public FirmwareRelease FirmwareVersion { get; private set; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Samples/P3bble/App.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/PingMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using P3bble.Constants;
4 |
5 | namespace P3bble.Messages
6 | {
7 | internal class PingMessage : P3bbleMessage
8 | {
9 | private byte[] _cookie;
10 |
11 | public PingMessage(byte[] cookie = null)
12 | : base(Endpoint.Ping)
13 | {
14 | if (cookie == null)
15 | {
16 | this._cookie = new byte[5] { 0x00, 0xEB, 0x00, 0x00, 0x00 };
17 | }
18 | else
19 | {
20 | this._cookie = cookie;
21 | }
22 | }
23 |
24 | public uint Cookie { get; private set; }
25 |
26 | protected override void AddContentToMessage(List payload)
27 | {
28 | payload.AddRange(this._cookie);
29 | }
30 |
31 | protected override void GetContentFromMessage(List payload)
32 | {
33 | this.Cookie = BitConverter.ToUInt32(payload.ToArray(), 1);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/App.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/InstalledApplication.cs:
--------------------------------------------------------------------------------
1 | namespace P3bble.Types
2 | {
3 | ///
4 | /// Represents an installed application
5 | ///
6 | public class InstalledApplication
7 | {
8 | ///
9 | /// Gets the application id
10 | ///
11 | public uint Id { get; internal set; }
12 |
13 | ///
14 | /// Gets the application index
15 | ///
16 | public uint Index { get; internal set; }
17 |
18 | ///
19 | /// Gets the name
20 | ///
21 | public string Name { get; internal set; }
22 |
23 | ///
24 | /// Gets the company
25 | ///
26 | public string Company { get; internal set; }
27 |
28 | ///
29 | /// Gets the flags
30 | ///
31 | public uint Flags { get; internal set; }
32 |
33 | ///
34 | /// Gets the version
35 | ///
36 | public ushort Version { get; internal set; }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/ResourcesManifest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 | using P3bble.Helper;
4 |
5 | namespace P3bble.Types
6 | {
7 | ///
8 | /// Gets the details of bundle resources
9 | ///
10 | [DataContract]
11 | public class ResourcesManifest : VersionInfo
12 | {
13 | ///
14 | /// Gets the filename.
15 | ///
16 | ///
17 | /// The filename.
18 | ///
19 | [DataMember(Name = "name", IsRequired = true)]
20 | public string Filename { get; private set; }
21 |
22 | ///
23 | /// Gets the CRC.
24 | ///
25 | ///
26 | /// The CRC.
27 | ///
28 | [DataMember(Name = "crc", IsRequired = true)]
29 | public uint CRC { get; private set; }
30 |
31 | ///
32 | /// Gets the size.
33 | ///
34 | ///
35 | /// The size.
36 | ///
37 | [DataMember(Name = "size", IsRequired = true)]
38 | public int Size { get; private set; }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("P3bble8.1")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("P3bble8.1")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/src/Samples/P3bble/XNAFrameworkDispatcherService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 | using System.Windows.Threading;
4 | using Microsoft.Xna.Framework;
5 |
6 | namespace P3bble
7 | {
8 | public class XNAFrameworkDispatcherService : IApplicationService
9 | {
10 | private DispatcherTimer frameworkDispatcherTimer;
11 |
12 | public XNAFrameworkDispatcherService()
13 | {
14 | this.frameworkDispatcherTimer = new DispatcherTimer();
15 | this.frameworkDispatcherTimer.Interval = TimeSpan.FromTicks(333333);
16 | this.frameworkDispatcherTimer.Tick += frameworkDispatcherTimer_Tick;
17 | FrameworkDispatcher.Update();
18 | }
19 |
20 | void frameworkDispatcherTimer_Tick(object sender, EventArgs e)
21 | {
22 | FrameworkDispatcher.Update();
23 | }
24 |
25 | void IApplicationService.StartService(ApplicationServiceContext context)
26 | {
27 | this.frameworkDispatcherTimer.Start();
28 | }
29 |
30 | void IApplicationService.StopService()
31 | {
32 | this.frameworkDispatcherTimer.Stop();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/XNAFrameworkDispatcherService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 | using System.Windows.Threading;
4 | using Microsoft.Xna.Framework;
5 |
6 | namespace P3bble
7 | {
8 | public class XNAFrameworkDispatcherService : IApplicationService
9 | {
10 | private DispatcherTimer frameworkDispatcherTimer;
11 |
12 | public XNAFrameworkDispatcherService()
13 | {
14 | this.frameworkDispatcherTimer = new DispatcherTimer();
15 | this.frameworkDispatcherTimer.Interval = TimeSpan.FromTicks(333333);
16 | this.frameworkDispatcherTimer.Tick += frameworkDispatcherTimer_Tick;
17 | FrameworkDispatcher.Update();
18 | }
19 |
20 | void frameworkDispatcherTimer_Tick(object sender, EventArgs e)
21 | {
22 | FrameworkDispatcher.Update();
23 | }
24 |
25 | void IApplicationService.StartService(ApplicationServiceContext context)
26 | {
27 | this.frameworkDispatcherTimer.Start();
28 | }
29 |
30 | void IApplicationService.StopService()
31 | {
32 | this.frameworkDispatcherTimer.Stop();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // Allgemeine Informationen über eine Assembly werden über die folgenden
6 | // Attribute gesteuert. Diese Attributwerte ändern, um die Informationen zu ändern,
7 | // die einer Assembly zugeordnet sind.
8 | [assembly: AssemblyTitle("P3bbleWP8")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("P3bbleWP8")]
13 | [assembly: AssemblyCopyright("Copyright © 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
18 | //
19 | // Hauptversion
20 | // Nebenversion
21 | // Buildnummer
22 | // Revision
23 | //
24 | // Es können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
25 | // mithilfe von '*' wie unten dargestellt übernommen werden:
26 | // [Assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/src/P3bble.PCL/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Resources;
2 | using System.Reflection;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("P3bble.PCL")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("P3bble.PCL")]
14 | [assembly: AssemblyCopyright("Copyright © 2014")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: NeutralResourcesLanguage("en")]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.1.1")]
30 | [assembly: AssemblyFileVersion("1.0.1.1")]
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 | packages
9 |
10 | # Build results
11 |
12 | [Dd]ebug/
13 | [Rr]elease/
14 | x64/
15 | build/
16 | [Bb]in/
17 | [Oo]bj/
18 |
19 | # MSTest test Results
20 | [Tt]est[Rr]esult*/
21 | [Bb]uild[Ll]og.*
22 |
23 | # ReSharper is a .NET coding add-in
24 | _ReSharper*/
25 | *.[Rr]e[Ss]harper
26 |
27 | # NuGet Packages Directory
28 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
29 | packages/
30 |
31 | # Windows Store app package directory
32 | AppPackages/
33 |
34 | # Others
35 | [Ss]tyle[Cc]op.*
36 |
37 | # Backup & report files from converting an old project file to a newer
38 | # Visual Studio version. Backup files are not needed, because we have git ;-)
39 | _UpgradeReport_Files/
40 | Backup*/
41 | UpgradeLog*.XML
42 | UpgradeLog*.htm
43 |
44 | #############
45 | ## Windows detritus
46 | #############
47 |
48 | # Windows image file caches
49 | Thumbs.db
50 | ehthumbs.db
51 |
52 | # Folder config file
53 | Desktop.ini
54 |
55 | # Recycle Bin used on file shares
56 | $RECYCLE.BIN/
57 |
58 | # Mac crap
59 | .DS_Store
60 |
61 | /NuGet/*.nupkg
62 |
--------------------------------------------------------------------------------
/NuGet/P3bble.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | P3bble
5 | {VERSION_MADE_BY_SCRIPT}
6 | P3bble
7 | Steve Robbins, Patrik Pfaffenbauer
8 | Steve Robbins, Patrik Pfaffenbauer
9 | https://raw.githubusercontent.com/p3root/P3bble/master/LICENSE.txt
10 | https://github.com/p3root/P3bble
11 | false
12 | P3bble is a framework for connecting to Pebble SmartWatches from Windows Phone 8 and Windows Phone 8.1.
13 | P3bble is a framework for connecting to Pebble SmartWatches from Windows Phone 8 and Windows Phone 8.1.
14 | en-US
15 | Copyright (c) 2013-2014 Patrik Pfaffenbauer, 2014 Steve Robbins
16 | Pebble WindowsPhone wp8 wp8.1
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/P3bble.Core/AsyncLock.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace P3bble
6 | {
7 | internal sealed class AsyncLock
8 | {
9 | private readonly SemaphoreSlim _semaphore = new SemaphoreSlim(1, 1);
10 | private readonly Task _releaser;
11 |
12 | public AsyncLock()
13 | {
14 | this._releaser = Task.FromResult((IDisposable)new Releaser(this));
15 | }
16 |
17 | public Task LockAsync()
18 | {
19 | var wait = this._semaphore.WaitAsync();
20 | return wait.IsCompleted ?
21 | this._releaser :
22 | wait.ContinueWith((_, state) => (IDisposable)state, this._releaser.Result, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
23 | }
24 |
25 | private sealed class Releaser : IDisposable
26 | {
27 | private readonly AsyncLock _toRelease;
28 |
29 | internal Releaser(AsyncLock toRelease)
30 | {
31 | this._toRelease = toRelease;
32 | }
33 |
34 | public void Dispose()
35 | {
36 | this._toRelease._semaphore.Release();
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/InstalledApplications.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace P3bble.Types
8 | {
9 | ///
10 | /// Represents the installed applications
11 | ///
12 | public class InstalledApplications
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | /// The banks.
18 | internal InstalledApplications(uint banks)
19 | {
20 | this.ApplicationBanks = banks;
21 | this.ApplicationsInstalled = new List();
22 | }
23 |
24 | ///
25 | /// Gets the number of application banks available.
26 | ///
27 | ///
28 | /// The application banks.
29 | ///
30 | public uint ApplicationBanks { get; private set; }
31 |
32 | ///
33 | /// Gets the applications installed.
34 | ///
35 | ///
36 | /// The applications installed.
37 | ///
38 | public List ApplicationsInstalled { get; private set; }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/BundleManifest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 | using P3bble.Helper;
4 |
5 | namespace P3bble.Types
6 | {
7 | [DataContract]
8 | internal class BundleManifest
9 | {
10 | [DataMember(Name = "manifestVersion", IsRequired = true)]
11 | public int ManifestVersion { get; private set; }
12 |
13 | public DateTime GeneratedAt
14 | {
15 | get
16 | {
17 | return this.GeneratedAtInternal.AsDateTime();
18 | }
19 | }
20 |
21 | [DataMember(Name = "generatedBy", IsRequired = true)]
22 | public string GeneratedBy { get; private set; }
23 |
24 | [DataMember(Name = "application", IsRequired = false)]
25 | public ApplicationManifest ApplicationManifest { get; private set; }
26 |
27 | [DataMember(Name = "firmware", IsRequired = false)]
28 | public FirmwareManifest Firmware { get; private set; }
29 |
30 | [DataMember(Name = "resources", IsRequired = false)]
31 | public ResourcesManifest Resources { get; private set; }
32 |
33 | [DataMember(Name = "type", IsRequired = true)]
34 | public string Type { get; private set; }
35 |
36 | [DataMember(Name = "generatedAt", IsRequired = true)]
37 | internal int GeneratedAtInternal { get; set; }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/NuGet/Package.ps1:
--------------------------------------------------------------------------------
1 | # TODO: Quieten mkdir
2 | $null = mkdir -Force package\lib\windowsphone8
3 | $null = mkdir -Force package\lib\windowsphone8.1
4 | $null = mkdir -Force package\lib\wpa8.1
5 | #$null = mkdir -Force package\lib\portable-net4+sl4+wp7+win8
6 |
7 | copy P3bble.nuspec package
8 |
9 | copy ..\src\P3bble.Core-8.1\bin\Release\P3bble.Core.dll package\lib\wpa8.1
10 | copy ..\src\P3bble.Core-8.1\bin\Release\P3bble.Core.pri package\lib\wpa8.1
11 |
12 | copy ..\src\P3bble.Core\Bin\Release\P3bble.Core.dll package\lib\windowsphone8
13 | copy ..\src\P3bble.Core\Bin\Release\P3bble.Core.XML package\lib\windowsphone8
14 |
15 | copy ..\src\P3bble.Core-S8.1\Bin\Release\P3bble.Core.dll package\lib\windowsphone8.1
16 | copy ..\src\P3bble.Core-S8.1\Bin\Release\P3bble.Core.XML package\lib\windowsphone8.1
17 |
18 | #copy ..\src\P3bble.PCL\Bin\Release\P3bble.PCL.dll package\lib\portable-net4+sl4+wp7+win8
19 |
20 | # Update version number to that of assembly...
21 | $ver = ls -fi .\package\lib\windowsphone8\P3bble.Core.dll | % { $_.versioninfo }
22 | $unversioned = Get-Content package\P3bble.nuspec
23 | $versioned = $unversioned -replace "{VERSION_MADE_BY_SCRIPT}", $ver.FileVersion
24 | Set-Content package\P3bble.nuspec $versioned
25 |
26 | # Finally, package up...
27 | Start-Process -FilePath ..\..\src\.nuget\nuget.exe -ArgumentList "pack P3bble.nuspec" -Wait -WindowStyle Hidden -WorkingDirectory package
28 |
29 | copy package\*.nupkg .
30 | #del package\*.nupkg
31 |
32 | # clear up working folder...
33 | #Remove-Item -Path package -Force -Recurse
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | License
2 |
3 | Copyright (c) 2014, Steve Robbins.
4 | Copyright (c) 2013-2014, p3root - Patrik Pfaffenbauer (patrik.pfaffenbauer@p3.co.at) All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7 |
8 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9 |
10 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11 |
12 | Neither the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 |
--------------------------------------------------------------------------------
/src/Samples/P3bble/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using System.Resources;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("P3bble")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("P3bble")]
14 | [assembly: AssemblyCopyright("Copyright © 2013")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 | [assembly: ComVisible(false)]
22 |
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM
24 | [assembly: Guid("3f07827e-3781-4849-89cc-4de2902dad55")]
25 |
26 | // Version information for an assembly consists of the following four values:
27 | //
28 | // Major Version
29 | // Minor Version
30 | // Build Number
31 | // Revision
32 | //
33 | // You can specify all the values or you can default the Revision and Build Numbers
34 | // by using the '*' as shown below:
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 | [assembly: NeutralResourcesLanguageAttribute("en-US")]
38 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using System.Resources;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("P3bble")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("P3bble")]
14 | [assembly: AssemblyCopyright("Copyright © 2013")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 | [assembly: ComVisible(false)]
22 |
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM
24 | [assembly: Guid("3f07827e-3781-4849-89cc-4de2902dad55")]
25 |
26 | // Version information for an assembly consists of the following four values:
27 | //
28 | // Major Version
29 | // Minor Version
30 | // Build Number
31 | // Revision
32 | //
33 | // You can specify all the values or you can default the Revision and Build Numbers
34 | // by using the '*' as shown below:
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 | [assembly: NeutralResourcesLanguageAttribute("en-US")]
38 |
--------------------------------------------------------------------------------
/src/P3bble.Core-8.1/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("P3bble")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("P3bble")]
14 | [assembly: AssemblyCopyright("Copyright © 2013-2014 Patrik Pfaffenbauer and Steve Robbins")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 | [assembly: ComVisible(false)]
22 |
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM
24 | [assembly: Guid("f5894170-64de-4859-aff8-b4f01cbcafb3")]
25 |
26 | // Version information for an assembly consists of the following four values:
27 | //
28 | // Major Version
29 | // Minor Version
30 | // Build Number
31 | // Revision
32 | //
33 | // You can specify all the values or you can default the Revision and Build Numbers
34 | // by using the '*' as shown below:
35 | [assembly: AssemblyVersion("2.2.1.1")]
36 | [assembly: AssemblyFileVersion("2.2.1.1")]
37 | [assembly: NeutralResourcesLanguageAttribute("en-US")]
38 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("P3bble")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("P3bble")]
14 | [assembly: AssemblyCopyright("Copyright © 2013-2014 Patrik Pfaffenbauer and Steve Robbins")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 | [assembly: ComVisible(false)]
22 |
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM
24 | [assembly: Guid("f5894170-64de-4859-aff8-b4f01cbcafb3")]
25 |
26 | // Version information for an assembly consists of the following four values:
27 | //
28 | // Major Version
29 | // Minor Version
30 | // Build Number
31 | // Revision
32 | //
33 | // You can specify all the values or you can default the Revision and Build Numbers
34 | // by using the '*' as shown below:
35 | [assembly: AssemblyVersion("2.2.1.1")]
36 | [assembly: AssemblyFileVersion("2.2.1.1")]
37 | [assembly: NeutralResourcesLanguageAttribute("en-US")]
38 |
--------------------------------------------------------------------------------
/src/P3bble.Core-S8.1/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("P3bble")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("P3bble")]
14 | [assembly: AssemblyCopyright("Copyright © 2013-2014 Patrik Pfaffenbauer and Steve Robbins")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 | [assembly: ComVisible(false)]
22 |
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM
24 | [assembly: Guid("f5894170-64de-4859-aff8-b4f01cbcafb3")]
25 |
26 | // Version information for an assembly consists of the following four values:
27 | //
28 | // Major Version
29 | // Minor Version
30 | // Build Number
31 | // Revision
32 | //
33 | // You can specify all the values or you can default the Revision and Build Numbers
34 | // by using the '*' as shown below:
35 | [assembly: AssemblyVersion("2.2.1.1")]
36 | [assembly: AssemblyFileVersion("2.2.1.1")]
37 | [assembly: NeutralResourcesLanguageAttribute("en-US")]
38 |
--------------------------------------------------------------------------------
/src/P3bbleWinRT.Core/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("P3bble")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("P3bble")]
14 | [assembly: AssemblyCopyright("Copyright © 2013-2014 Patrik Pfaffenbauer and Steve Robbins")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 | [assembly: ComVisible(false)]
22 |
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM
24 | [assembly: Guid("f5894170-64de-4859-aff8-b4f01cbcafb3")]
25 |
26 | // Version information for an assembly consists of the following four values:
27 | //
28 | // Major Version
29 | // Minor Version
30 | // Build Number
31 | // Revision
32 | //
33 | // You can specify all the values or you can default the Revision and Build Numbers
34 | // by using the '*' as shown below:
35 | [assembly: AssemblyVersion("2.2.1.0")]
36 | [assembly: AssemblyFileVersion("2.2.1.0")]
37 | [assembly: NeutralResourcesLanguageAttribute("en-US")]
38 |
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | P3bble
6 | Patrik
7 | Assets\StoreLogo.png
8 |
9 |
10 | 6.3.0
11 | 6.3.0
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/FirmwareRelease.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 | using P3bble.Helper;
4 |
5 | namespace P3bble.Types
6 | {
7 | ///
8 | /// Details about a firmware release
9 | ///
10 | [DataContract]
11 | public class FirmwareRelease : VersionInfo
12 | {
13 | ///
14 | /// Gets the URL.
15 | ///
16 | ///
17 | /// The URL.
18 | ///
19 | [DataMember(Name = "url", IsRequired = true)]
20 | public string Url { get; private set; }
21 |
22 | ///
23 | /// Gets the notes.
24 | ///
25 | ///
26 | /// The notes.
27 | ///
28 | [DataMember(Name = "notes", IsRequired = true)]
29 | public string Notes { get; private set; }
30 |
31 | ///
32 | /// Gets the checksum.
33 | ///
34 | ///
35 | /// The checksum.
36 | ///
37 | [DataMember(Name = "sha-256", IsRequired = true)]
38 | public string Checksum { get; private set; }
39 |
40 | ///
41 | /// Returns a that represents this instance.
42 | ///
43 | ///
44 | /// A that represents this instance.
45 | ///
46 | public override string ToString()
47 | {
48 | string format = "Version: {0}\n"
49 | + "Url: {1}\n"
50 | + "Notes: {2}\n";
51 | return string.Format(format, this.Version, this.Url, this.Notes);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/PhoneVersionMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using P3bble.Constants;
5 | using P3bble.PCL;
6 |
7 | namespace P3bble.Messages
8 | {
9 | internal class PhoneVersionMessage : P3bbleMessage
10 | {
11 | private const uint PhoneSessionCaps = (uint)SessionCaps.GammaRay;
12 | private const uint RemoteCapsMusicControl = (uint)(RemoteCaps.Telephony | RemoteCaps.Sms | RemoteCaps.Android | RemoteCaps.Gps);
13 | private const uint RemoteCapsNormal = (uint)(RemoteCaps.Telephony | RemoteCaps.Sms | RemoteCaps.Windows | RemoteCaps.Gps);
14 |
15 | private uint _remoteCaps;
16 |
17 | public PhoneVersionMessage(bool musicControlEnabled)
18 | : base(Endpoint.PhoneVersion)
19 | {
20 | ServiceLocator.Logger.WriteLine("PhoneVersionMessage musicControlEnabled=" + musicControlEnabled.ToString());
21 | if (musicControlEnabled)
22 | {
23 | this._remoteCaps = RemoteCapsMusicControl;
24 | }
25 | else
26 | {
27 | this._remoteCaps = RemoteCapsNormal;
28 | }
29 | }
30 |
31 | protected override void GetContentFromMessage(List payload)
32 | {
33 | }
34 |
35 | protected override void AddContentToMessage(List payload)
36 | {
37 | byte[] prefix = { 0x01, 0xFF, 0xFF, 0xFF, 0xFF };
38 | byte[] session = BitConverter.GetBytes(PhoneSessionCaps);
39 | byte[] remote = BitConverter.GetBytes(this._remoteCaps);
40 | if (BitConverter.IsLittleEndian)
41 | {
42 | Array.Reverse(session);
43 | Array.Reverse(remote);
44 | }
45 |
46 | byte[] msg = new byte[0];
47 | msg = msg.Concat(prefix).Concat(session).Concat(remote).ToArray();
48 |
49 | payload.AddRange(msg);
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/VersionMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using P3bble.Constants;
6 | using P3bble.Types;
7 |
8 | namespace P3bble.Messages
9 | {
10 | internal class VersionMessage : P3bbleMessage
11 | {
12 | public VersionMessage()
13 | : base(Endpoint.Version)
14 | {
15 | }
16 |
17 | public FirmwareVersion Firmware { get; private set; }
18 |
19 | public FirmwareVersion RecoveryFirmware { get; private set; }
20 |
21 | protected override void AddContentToMessage(List payload)
22 | {
23 | payload.Add(0x00);
24 | }
25 |
26 | protected override void GetContentFromMessage(List payload)
27 | {
28 | byte[] data = payload.ToArray();
29 |
30 | this.Firmware = ParseVersion(data.Skip(1).Take(47).ToArray());
31 | this.RecoveryFirmware = ParseVersion(data.Skip(48).Take(47).ToArray());
32 | }
33 |
34 | private static FirmwareVersion ParseVersion(byte[] data)
35 | {
36 | byte[] _ts = data.Take(4).ToArray();
37 | if (BitConverter.IsLittleEndian)
38 | {
39 | Array.Reverse(_ts);
40 | }
41 |
42 | int timestamp = BitConverter.ToInt32(_ts, 0);
43 | string version = Encoding.UTF8.GetString(data.Skip(4).Take(32).ToArray(), 0, 32);
44 | string commit = Encoding.UTF8.GetString(data.Skip(36).Take(8).ToArray(), 0, 8);
45 | version = version.Substring(0, version.IndexOf('\0'));
46 | commit = commit.Substring(0, commit.IndexOf('\0'));
47 | bool is_recovery = BitConverter.ToBoolean(data, 44);
48 | byte hardware_platform = data[45];
49 | byte metadata_ver = data[46];
50 | return new FirmwareVersion(timestamp, version, commit, is_recovery, hardware_platform, metadata_ver);
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/ApplicationManifest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 | using P3bble.Helper;
4 |
5 | namespace P3bble.Types
6 | {
7 | ///
8 | /// Represents an application manifest
9 | ///
10 | [DataContract]
11 | public struct ApplicationManifest
12 | {
13 | ///
14 | /// Gets the filename.
15 | ///
16 | ///
17 | /// The filename.
18 | ///
19 | [DataMember(Name = "name", IsRequired = true)]
20 | public string Filename { get; private set; }
21 |
22 | ///
23 | /// Gets the required firmware version.
24 | ///
25 | ///
26 | /// The required firmware version.
27 | ///
28 | [DataMember(Name = "reqFwVer", IsRequired = false)]
29 | public int RequiredFirmwareVersion { get; private set; }
30 |
31 | ///
32 | /// Gets the timestamp.
33 | ///
34 | ///
35 | /// The timestamp.
36 | ///
37 | public DateTime Timestamp
38 | {
39 | get
40 | {
41 | return this.TimestampInternal.AsDateTime();
42 | }
43 | }
44 |
45 | ///
46 | /// Gets the CRC.
47 | ///
48 | ///
49 | /// The CRC.
50 | ///
51 | [DataMember(Name = "crc", IsRequired = true)]
52 | public uint CRC { get; private set; }
53 |
54 | ///
55 | /// Gets the size.
56 | ///
57 | ///
58 | /// The size.
59 | ///
60 | [DataMember(Name = "size", IsRequired = true)]
61 | public int Size { get; private set; }
62 |
63 | [DataMember(Name = "timestamp", IsRequired = true)]
64 | internal int TimestampInternal { get; set; }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Properties/WMAppManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Assets\ApplicationIcon.png
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | Assets\Tiles\FlipCycleTileSmall.png
21 | 0
22 | Assets\Tiles\FlipCycleTileMedium.png
23 | P3bble
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | P3bble
7 | Patrik Pfaffenbauer
8 | Assets\StoreLogo.png
9 |
10 |
11 | 6.3.1
12 | 6.3.1
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/NotificationMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using P3bble.Constants;
7 |
8 | namespace P3bble.Messages
9 | {
10 | ///
11 | /// Represents a notification type
12 | ///
13 | internal enum NotificationType
14 | {
15 | ///
16 | /// The email type
17 | ///
18 | Email = 0,
19 |
20 | ///
21 | /// The SMS type
22 | ///
23 | SMS = 1,
24 |
25 | ///
26 | /// The facebook type
27 | ///
28 | Facebook = 2
29 | }
30 |
31 | internal class NotificationMessage : P3bbleMessage
32 | {
33 | private NotificationType _type;
34 | private List _parts;
35 |
36 | public NotificationMessage(NotificationType type, params string[] parts)
37 | : base(Endpoint.Notification)
38 | {
39 | this._type = type;
40 | this._parts = parts.ToList();
41 | }
42 |
43 | protected override void AddContentToMessage(List payload)
44 | {
45 | string[] ts = { (new DateTime(1970, 1, 1) - DateTime.Now).TotalSeconds.ToString() };
46 | string[] parts = this._parts.Take(2).Concat(ts).Concat(this._parts.Skip(2)).ToArray();
47 | byte[] data = { (byte)this._type };
48 |
49 | foreach (string part in parts)
50 | {
51 | byte[] _part = Encoding.UTF8.GetBytes(part);
52 | if (_part.Length > 255)
53 | {
54 | _part = _part.Take(255).ToArray();
55 | }
56 |
57 | byte[] len = { Convert.ToByte(_part.Length) };
58 | data = data.Concat(len).Concat(_part).ToArray();
59 | }
60 |
61 | payload.AddRange(data);
62 | }
63 |
64 | protected override void GetContentFromMessage(List payload)
65 | {
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/Samples/P3bble/Properties/WMAppManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Assets\ApplicationIcon.png
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | Assets\Tiles\FlipCycleTileSmall.png
21 | 0
22 | Assets\Tiles\FlipCycleTileMedium.png
23 | P3bble
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Constants/RemoteCaps.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace P3bble.Constants
8 | {
9 | ///
10 | /// The phone capabilites
11 | ///
12 | [Flags]
13 | internal enum RemoteCaps : uint
14 | {
15 | ///
16 | /// Unknown capability
17 | ///
18 | Unknown = 0,
19 |
20 | ///
21 | /// IOS platform
22 | ///
23 | IOS = 1,
24 |
25 | ///
26 | /// Android platform
27 | ///
28 | Android = 2,
29 |
30 | ///
31 | /// OSX platform
32 | ///
33 | OSX = 3,
34 |
35 | ///
36 | /// Linux platform
37 | ///
38 | Linux = 4,
39 |
40 | ///
41 | /// Windows platform
42 | ///
43 | Windows = 5,
44 |
45 | ///
46 | /// The telephony capability
47 | ///
48 | Telephony = 16,
49 |
50 | ///
51 | /// The SMS capability
52 | ///
53 | Sms = 32,
54 |
55 | ///
56 | /// The GPS capability
57 | ///
58 | Gps = 64,
59 |
60 | ///
61 | /// The BTLE capability
62 | ///
63 | BTLE = 128,
64 |
65 | ///
66 | /// The front camera capability
67 | ///
68 | CameraFront = 240,
69 |
70 | ///
71 | /// The rear camera capability
72 | ///
73 | CameraRear = 256,
74 |
75 | ///
76 | /// The acceleromter capability
77 | ///
78 | Acceleromter = 512,
79 |
80 | ///
81 | /// The gyroscope capability
82 | ///
83 | Gyroscope = 1024,
84 |
85 | ///
86 | /// The compass capability
87 | ///
88 | Compass = 2048
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/TimeMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using P3bble.Constants;
5 | using P3bble.Helper;
6 | using P3bble.PCL;
7 |
8 | namespace P3bble.Messages
9 | {
10 | ///
11 | /// Represents the time message
12 | ///
13 | internal enum TimeMessageAction : byte
14 | {
15 | ///
16 | /// Get the time
17 | ///
18 | GetTime = 0,
19 |
20 | ///
21 | /// Set the time
22 | ///
23 | SetTime = 2
24 | }
25 |
26 | internal class TimeMessage : P3bbleMessage
27 | {
28 | private TimeMessageAction _action;
29 |
30 | public TimeMessage()
31 | : base(Endpoint.Time)
32 | {
33 | this._action = TimeMessageAction.GetTime;
34 | }
35 |
36 | public TimeMessage(DateTime time)
37 | : base(Endpoint.Time)
38 | {
39 | this._action = TimeMessageAction.SetTime;
40 | this.Time = time;
41 | }
42 |
43 | public DateTime Time { get; private set; }
44 |
45 | protected override void AddContentToMessage(List payload)
46 | {
47 | if (this._action == TimeMessageAction.GetTime)
48 | {
49 | payload.Add((byte)this._action);
50 | }
51 | else
52 | {
53 | ServiceLocator.Logger.WriteLine("Set Time to " + this.Time.ToString());
54 |
55 | byte[] rawTime = BitConverter.GetBytes(this.Time.AsEpoch());
56 | if (BitConverter.IsLittleEndian)
57 | {
58 | Array.Reverse(rawTime);
59 | }
60 |
61 | // Magic number required for the time to be set!
62 | payload.Add((byte)this._action);
63 |
64 | payload.AddRange(rawTime);
65 | }
66 | }
67 |
68 | protected override void GetContentFromMessage(List payload)
69 | {
70 | byte[] payloadArray = payload.ToArray();
71 | if (BitConverter.IsLittleEndian)
72 | {
73 | Array.Reverse(payloadArray, 1, 4);
74 | }
75 |
76 | int timestamp = BitConverter.ToInt32(payloadArray, 1);
77 | this.Time = timestamp.AsDateTime();
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/src/Samples/P3bble/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 | P3bble
12 | Patrik
13 | Assets\StoreLogo.png
14 |
15 |
16 |
17 | 6.3.1
18 | 6.3.1
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | AgHostSvcs.dll
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 | P3bble
12 | Patrik
13 | Assets\StoreLogo.png
14 |
15 |
16 |
17 | 6.3.1
18 | 6.3.1
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | AgHostSvcs.dll
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/FirmwareManifest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 | using P3bble.Helper;
4 |
5 | namespace P3bble.Types
6 | {
7 | ///
8 | /// Represents details of a firmware bundle
9 | ///
10 | [DataContract]
11 | public struct FirmwareManifest
12 | {
13 | ///
14 | /// Gets the filename.
15 | ///
16 | ///
17 | /// The filename.
18 | ///
19 | [DataMember(Name = "name", IsRequired = true)]
20 | public string Filename { get; private set; }
21 |
22 | ///
23 | /// Gets the timestamp.
24 | ///
25 | ///
26 | /// The timestamp.
27 | ///
28 | public DateTime Timestamp
29 | {
30 | get
31 | {
32 | return this.TimestampInternal.AsDateTime();
33 | }
34 | }
35 |
36 | ///
37 | /// Gets the CRC.
38 | ///
39 | ///
40 | /// The CRC.
41 | ///
42 | [DataMember(Name = "crc", IsRequired = true)]
43 | public uint CRC { get; private set; }
44 |
45 | ///
46 | /// Gets the hardware revision.
47 | ///
48 | ///
49 | /// The hardware revision.
50 | ///
51 | [DataMember(Name = "hwrev", IsRequired = true)]
52 | public string HardwareRevision { get; private set; }
53 |
54 | ///
55 | /// Gets the type.
56 | ///
57 | ///
58 | /// The type.
59 | ///
60 | [DataMember(Name = "type", IsRequired = true)]
61 | public string Type { get; private set; }
62 |
63 | ///
64 | /// Gets a value indicating whether the firmware is recovery.
65 | ///
66 | ///
67 | /// true if recovery.
68 | ///
69 | public bool IsRecovery
70 | {
71 | get
72 | {
73 | return this.Type == "recovery";
74 | }
75 | }
76 |
77 | ///
78 | /// Gets the size.
79 | ///
80 | ///
81 | /// The size.
82 | ///
83 | [DataMember(Name = "size", IsRequired = true)]
84 | public int Size { get; private set; }
85 |
86 | [DataMember(Name = "timestamp", IsRequired = true)]
87 | internal int TimestampInternal { get; set; }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/MusicMessage.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using System.Text;
4 | using P3bble.Constants;
5 | using P3bble.Types;
6 |
7 | namespace P3bble.Messages
8 | {
9 | internal class MusicMessage : P3bbleMessage
10 | {
11 | private string _artist;
12 | private string _album;
13 | private string _track;
14 |
15 | public MusicMessage()
16 | : base(Endpoint.MusicControl)
17 | {
18 | }
19 |
20 | public MusicMessage(string artist, string album, string track)
21 | : base(Endpoint.MusicControl)
22 | {
23 | this._artist = artist;
24 | this._album = album;
25 | this._track = track;
26 |
27 | // Check lengths...
28 | this.TrimValue(ref this._artist);
29 | this.TrimValue(ref this._album);
30 | this.TrimValue(ref this._track);
31 | }
32 |
33 | ///
34 | /// Gets or sets the control action.
35 | ///
36 | ///
37 | /// The control action.
38 | ///
39 | public MusicControlAction ControlAction { get; set; }
40 |
41 | protected override void AddContentToMessage(List payload)
42 | {
43 | // No idea what this does. Do it anyway.
44 | byte[] data = { 16 };
45 |
46 | byte[] artist = Encoding.UTF8.GetBytes(this._artist);
47 | byte[] album = Encoding.UTF8.GetBytes(this._album);
48 | byte[] track = Encoding.UTF8.GetBytes(this._track);
49 | byte[] artistlen = { (byte)artist.Length };
50 | byte[] albumlen = { (byte)album.Length };
51 | byte[] tracklen = { (byte)track.Length };
52 |
53 | data = data.Concat(artistlen).Concat(artist).ToArray();
54 | data = data.Concat(albumlen).Concat(album).ToArray();
55 | data = data.Concat(tracklen).Concat(track).ToArray();
56 |
57 | payload.AddRange(data);
58 | }
59 |
60 | protected override void GetContentFromMessage(List payload)
61 | {
62 | this.ControlAction = (MusicControlAction)payload[0];
63 | }
64 |
65 | ///
66 | /// Trims a value to the max length we can send.
67 | ///
68 | /// The value.
69 | private void TrimValue(ref string value)
70 | {
71 | if (value != null && value.Length > 30)
72 | {
73 | value = value.Substring(0, 27) + "...";
74 | }
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/Settings.StyleCop:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | api.developer.nokia.com
5 | appCode
6 | AppCode
7 | appId
8 | AppID
9 | json
10 | params
11 | querystring
12 |
13 |
14 |
15 |
16 |
17 |
18 | \.g\.cs$
19 | \.generated\.cs$
20 | \.g\.i\.cs$
21 | TemporaryGeneratedFile_.*\.cs$
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | False
32 |
33 |
34 |
35 |
36 | False
37 |
38 |
39 |
40 |
41 | False
42 |
43 |
44 |
45 |
46 | False
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | False
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | False
67 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/src/P3bble.PCL/P3bble.PCL.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 11.0
6 | Debug
7 | AnyCPU
8 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}
9 | Library
10 | Properties
11 | P3bble.PCL
12 | P3bble.PCL
13 | v4.5
14 | Profile259
15 | 512
16 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
17 |
18 |
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
51 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Logger.cs:
--------------------------------------------------------------------------------
1 | using P3bble.PCL;
2 | using P3bble.PCL.Logger;
3 | using System;
4 | using System.Diagnostics;
5 | using System.IO;
6 | #if WINDOWS_PHONE_APP
7 | #else
8 | using System.IO.IsolatedStorage;
9 | #endif
10 | using System.Threading;
11 | using Windows.Storage;
12 |
13 | namespace P3bble
14 | {
15 | ///
16 | /// Logging to track down problems in production apps
17 | ///
18 | internal class Logger : BaseLogger
19 | {
20 | private string FileName { get; set; }
21 |
22 | ///
23 | /// Writes a line to the debug log.
24 | ///
25 | /// The message.
26 | public override void WriteLine(string message)
27 | {
28 | Debug.WriteLine(message);
29 |
30 | if (string.IsNullOrEmpty(FileName))
31 | {
32 | FileName = string.Format("Log-{0:yyyy-MM-dd-HH-mm-ss}.txt", DateTime.Now);
33 | Debug.WriteLine("Logger initialised; writing to " + FileName);
34 | }
35 |
36 | lock (FileName)
37 | {
38 | if (IsEnabled)
39 | {
40 | using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
41 | {
42 | using (StreamWriter sw = new StreamWriter(store.OpenFile(FileName, FileMode.Append, FileAccess.Write)))
43 | {
44 | sw.Write(message + "\n");
45 | }
46 | }
47 | }
48 | else
49 | {
50 | // This is a HORRIBLE hack!
51 | // There is something strange happening in message sequencing that goes
52 | // away when logging to a file - so when RELEASE mode with logging OFF,
53 | // this is my only alternative for now. I am a bad person.
54 | Thread.Sleep(10);
55 | }
56 | }
57 | }
58 |
59 | ///
60 | /// Clears up the current log file.
61 | ///
62 | public override void ClearUp()
63 | {
64 | if (!string.IsNullOrEmpty(FileName))
65 | {
66 | lock (FileName)
67 | {
68 | using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
69 | {
70 | store.DeleteFile(FileName);
71 | }
72 | }
73 |
74 | FileName = null;
75 | }
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/SystemMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using P3bble.Constants;
6 |
7 | namespace P3bble.Messages
8 | {
9 | ///
10 | /// System command
11 | ///
12 | internal enum SystemCommand : byte
13 | {
14 | ///
15 | /// The firmware available command
16 | ///
17 | FirmwareAvailable = 0,
18 |
19 | ///
20 | /// The firmware start command
21 | ///
22 | FirmwareStart = 1,
23 |
24 | ///
25 | /// The firmware complete command
26 | ///
27 | FirmwareComplete = 2,
28 |
29 | ///
30 | /// The firmware fail command
31 | ///
32 | FirmwareFail = 3,
33 |
34 | ///
35 | /// The firmware up to date command
36 | ///
37 | FirmwareUpToDate = 4,
38 |
39 | ///
40 | /// The firmware out of date command
41 | ///
42 | FirmwareOutOfDate = 5,
43 |
44 | ///
45 | /// The bluetooth start discoverable command
46 | ///
47 | BluetoothStartDiscoverable = 6,
48 |
49 | ///
50 | /// The bluetooth end discoverable command
51 | ///
52 | BluetoothEndDiscoverable = 7
53 | }
54 |
55 | ///
56 | /// The System Message
57 | ///
58 | /// These messages are used to signal important events/state-changes to the watch firmware.
59 | ///
60 | ///
61 | internal class SystemMessage : P3bbleMessage
62 | {
63 | public SystemMessage()
64 | : base(Endpoint.SystemMessage)
65 | {
66 | }
67 |
68 | public SystemMessage(SystemCommand command)
69 | : this()
70 | {
71 | this.Command = command;
72 | }
73 |
74 | ///
75 | /// Gets the system command.
76 | ///
77 | ///
78 | /// The system command.
79 | ///
80 | public SystemCommand Command { get; private set; }
81 |
82 | protected override void AddContentToMessage(List payload)
83 | {
84 | payload.Add(0);
85 |
86 | // Add the command
87 | payload.Add((byte)this.Command);
88 | }
89 |
90 | protected override void GetContentFromMessage(List payload)
91 | {
92 | this.Command = (SystemCommand)payload[1];
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/PhoneControlMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using P3bble.Constants;
6 |
7 | namespace P3bble.Messages
8 | {
9 | ///
10 | /// Represents the phone control type
11 | ///
12 | internal enum PhoneControlType : byte
13 | {
14 | ///
15 | /// Answer the phone
16 | ///
17 | Answer = 1,
18 |
19 | ///
20 | /// Hang up the phone
21 | ///
22 | HangUp = 2,
23 |
24 | ///
25 | /// Get state
26 | ///
27 | GetState = 3,
28 |
29 | ///
30 | /// Incoming call
31 | ///
32 | IncomingCall = 4,
33 |
34 | ///
35 | /// Outgoing call
36 | ///
37 | OutgoingCall = 5,
38 |
39 | ///
40 | /// Missed call
41 | ///
42 | MissedCall = 6,
43 |
44 | ///
45 | /// Ring the phone
46 | ///
47 | Ring = 7,
48 |
49 | ///
50 | /// Start the phone
51 | ///
52 | Start = 8,
53 |
54 | ///
55 | /// End the phone
56 | ///
57 | End = 9
58 | }
59 |
60 | internal class PhoneControlMessage : P3bbleMessage
61 | {
62 | private PhoneControlType _type;
63 | private List _parts;
64 | private byte[] _cookie;
65 |
66 | public PhoneControlMessage(PhoneControlType type, byte[] cookie, params string[] parts)
67 | : base(Endpoint.PhoneControl)
68 | {
69 | this._type = type;
70 | this._parts = parts.ToList();
71 | this._cookie = cookie;
72 | }
73 |
74 | protected override void AddContentToMessage(List payload)
75 | {
76 | string[] parts = this._parts.ToArray();
77 | byte[] data = { (byte)this._type, };
78 |
79 | data = data.Concat(this._cookie).ToArray();
80 |
81 | foreach (string part in parts)
82 | {
83 | byte[] bytePart = Encoding.UTF8.GetBytes(part);
84 | if (bytePart.Length > 255)
85 | {
86 | bytePart = bytePart.Take(255).ToArray();
87 | }
88 |
89 | byte[] len = { Convert.ToByte(bytePart.Length) };
90 | data = data.Concat(len).Concat(bytePart).ToArray();
91 | }
92 |
93 | payload.AddRange(data);
94 | }
95 |
96 | protected override void GetContentFromMessage(List payload)
97 | {
98 | }
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | P3bble
2 | ======
3 |
4 | P3bble is a framework for connecting to Pebble SmartWatches from Windows Phone 8.
5 |
6 | ## Donate
7 | [](https://en.cryptobadges.io/donate/1Ck4XgAxys3aBjdesKQQ62zx7m4vozUest)
8 |
9 | Donate DogeCoin: DPVz6RSAJrXZqTF4sGXpS1dqwvU36hSaAQ
10 |
11 |
12 |
13 | Getting Started:
14 | ================
15 |
16 | * Install [P3bble](https://www.nuget.org/packages/P3bble) from Nuget or clone this repo and build from source.
17 | * Add `ID_CAP_PROXIMITY` to WMAppManifest.xml to allow connections from your app.
18 | * Detect and connect to the first Pebble found:
19 |
20 | To use the library with Windows Phone 8.1 and WinRT (WinRT not finished currently), you need to add this
21 |
22 | ```
23 |
24 |
25 |
26 |
27 |
28 | ```
29 | in your Package.appxmanifest beetween the "Capabilities" Tag.
30 |
31 | ```
32 | var pebbles = await P3bble.Pebble.DetectPebbles();
33 | if (pebbles != null && pebbles.Count > 0)
34 | {
35 | bool connected = await pebbles[0].ConnectAsync();
36 | if (connected)
37 | {
38 | MessageBox.Show("connected to " + pebbles[0].DisplayName);
39 | }
40 | else
41 | {
42 | MessageBox.Show("could not connect");
43 | }
44 | }
45 | ```
46 | Version 2.2 features:
47 | =====================
48 | * Added support for Windows Phone Silverlight 8.1
49 | * Added support for Windows Phone 8.1
50 |
51 |
52 |
53 | Version 2.0 features:
54 | =====================
55 |
56 | * Get and Set Time
57 | * List installed apps
58 | * Remove app by index
59 | * Install app from PBW
60 | * Launch app
61 | * Install firmware
62 | * Music control works from foreground app
63 | * Refactored methods to be async/await instead of using events
64 | * Patched FindPebbles to only include items starting "Pebble"
65 | * Added interface for P3bble to allow mocking
66 | * Changed from WebClient to [HttpClient](https://www.nuget.org/packages/Microsoft.Net.Http) to make code more portable
67 | * Changed from SharpGISto [sharpcompress](https://www.nuget.org/packages/sharpcompress/) to make code more portable
68 |
69 | Version 2.0 features were added by [Steve Robbins](https://twitter.com/sr_gb) - but they were only possible because of the work that Patrik did originally as well as the [Python reverse engineering work](https://github.com/Hexxeh/libpebble).
70 |
71 | *TODO: WinRT not working yet - unable to connect to Bluetooth paired devices - any help getting this working appreciated!*
72 |
73 | Version 1.0
74 | ===========
75 | Version 1.0 created by [Patrik Pfaffenbauer](https://twitter.com/p3root) - see
76 |
77 |
78 | License
79 | =======
80 |
81 | P3bble is released under the 3-clause license ("New BSD License" or "Modified BSD License") - see https://raw.githubusercontent.com/p3root/P3bble/master/LICENSE.txt
82 |
83 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Constants/Endpoint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace P3bble.Constants
8 | {
9 | ///
10 | /// The endpoint
11 | ///
12 | internal enum Endpoint
13 | {
14 | ///
15 | /// Firmware endpoint
16 | ///
17 | Firmware = 1,
18 |
19 | ///
20 | /// Time endpoint
21 | ///
22 | Time = 11,
23 |
24 | ///
25 | /// Version endpoint
26 | ///
27 | Version = 16,
28 |
29 | ///
30 | /// Pebble is requesting details about the phone version
31 | ///
32 | PhoneVersion = 17,
33 |
34 | ///
35 | /// The system message endpoint
36 | ///
37 | SystemMessage = 18,
38 |
39 | ///
40 | /// The music control endpoint
41 | ///
42 | MusicControl = 32,
43 |
44 | ///
45 | /// The phone control endpoint
46 | ///
47 | PhoneControl = 33,
48 |
49 | ///
50 | /// The application message endpoint
51 | ///
52 | ApplicationMessage = 48,
53 |
54 | ///
55 | /// The launcher endpoint
56 | ///
57 | Launcher = 49,
58 |
59 | ///
60 | /// The logs endpoint
61 | ///
62 | Logs = 2000,
63 |
64 | ///
65 | /// The ping endpoint
66 | ///
67 | Ping = 2001,
68 |
69 | ///
70 | /// The logs dump endpoint
71 | ///
72 | LogsDump = 2002,
73 |
74 | ///
75 | /// The reset endpoint
76 | ///
77 | Reset = 2003,
78 |
79 | ////AppMfg = 2004, - seems unused
80 |
81 | ///
82 | /// The application logs endpoint
83 | ///
84 | AppLogs = 2006,
85 |
86 | ///
87 | /// The notification endpoint
88 | ///
89 | Notification = 3000,
90 |
91 | ///
92 | /// The resource endpoint
93 | ///
94 | Resource = 4000,
95 |
96 | ///
97 | /// The system reg endpoint
98 | ///
99 | SysReg = 5000,
100 |
101 | ///
102 | /// The FCT reg endpoint
103 | ///
104 | FctReg = 5001,
105 |
106 | ///
107 | /// The application manager endpoint
108 | ///
109 | AppManager = 6000,
110 |
111 | ///
112 | /// The run keeper endpoint
113 | ///
114 | RunKeeper = 7000,
115 |
116 | ///
117 | /// The put bytes endpoint
118 | ///
119 | PutBytes = 48879
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/LogsMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using P3bble.Constants;
7 | using P3bble.Helper;
8 |
9 | namespace P3bble.Messages
10 | {
11 | ///
12 | /// The log level
13 | ///
14 | internal enum LogLevel
15 | {
16 | ///
17 | /// All levels
18 | ///
19 | All = 0,
20 |
21 | ///
22 | /// The error level
23 | ///
24 | Error = 1,
25 |
26 | ///
27 | /// The warning level
28 | ///
29 | Warning = 50,
30 |
31 | ///
32 | /// The information level
33 | ///
34 | Information = 100,
35 |
36 | ///
37 | /// The debug level
38 | ///
39 | Debug = 200,
40 |
41 | ///
42 | /// The verbose level
43 | ///
44 | Verbose = 250
45 | }
46 |
47 | internal class LogsMessage : P3bbleMessage
48 | {
49 | public LogsMessage()
50 | : base(Endpoint.Logs)
51 | {
52 | }
53 |
54 | public DateTime Timestamp { get; private set; }
55 |
56 | public short LineNo { get; private set; }
57 |
58 | public string Filename { get; private set; }
59 |
60 | public string Message { get; private set; }
61 |
62 | public LogLevel LogLevel
63 | {
64 | get
65 | {
66 | return (LogLevel)this.LevelInternal;
67 | }
68 | }
69 |
70 | internal byte LevelInternal { get; set; }
71 |
72 | protected override void AddContentToMessage(List payload)
73 | {
74 | }
75 |
76 | protected override void GetContentFromMessage(List payload)
77 | {
78 | byte[] payloadArray = payload.ToArray();
79 | byte[] metadata = new byte[8];
80 | byte msgsize;
81 | Array.Copy(payloadArray, metadata, 8);
82 | /*
83 | * Unpack the metadata. Eight bytes:
84 | * 0..3 -> integer timestamp
85 | * 4 -> Message level (severity)
86 | * 5 -> Size of the message
87 | * 6..7 -> Line number (?)
88 | */
89 | if (BitConverter.IsLittleEndian)
90 | {
91 | Array.Reverse(metadata);
92 | this.Timestamp = BitConverter.ToInt32(metadata, 4).AsDateTime();
93 | this.LevelInternal = metadata[3];
94 | msgsize = metadata[2];
95 | this.LineNo = BitConverter.ToInt16(metadata, 0);
96 | }
97 | else
98 | {
99 | this.Timestamp = BitConverter.ToInt32(metadata, 0).AsDateTime();
100 | this.LevelInternal = metadata[4];
101 | msgsize = metadata[5];
102 | this.LineNo = BitConverter.ToInt16(metadata, 6);
103 | }
104 |
105 | // Now to extract the actual data
106 | byte[] _filename = new byte[16];
107 | byte[] _data = new byte[msgsize];
108 | Array.Copy(payloadArray, 8, _filename, 0, 16);
109 | Array.Copy(payloadArray, 24, _data, 0, msgsize);
110 |
111 | this.Filename = Encoding.UTF8.GetString(_filename, 0, 16);
112 | this.Message = Encoding.UTF8.GetString(_data, 0, msgsize);
113 | }
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/FirmwareVersion.cs:
--------------------------------------------------------------------------------
1 | using P3bble.Constants;
2 |
3 | namespace P3bble.Types
4 | {
5 | ///
6 | /// Represents firmware version information from the Pebble
7 | ///
8 | public class FirmwareVersion : VersionInfo
9 | {
10 | private const string URL = "http://pebblefw.s3.amazonaws.com/pebble/{0}/{1}-v2/latest.json";
11 |
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// The timestamp.
16 | /// The version.
17 | /// The commit.
18 | /// if set to true [isrecovery].
19 | /// The hardwareplatform.
20 | /// The metadataversion.
21 | public FirmwareVersion(int timestamp, string version, string commit, bool isrecovery, byte hardwareplatform, byte metadataversion)
22 | {
23 | this.TimestampInternal = timestamp;
24 | this.VersionInternal = version;
25 | this.Commit = commit;
26 | this.IsRecovery = isrecovery;
27 | this.HardwarePlatform = hardwareplatform;
28 | this.HardwareRevision = (HardwareRevision)hardwareplatform;
29 | this.MetadataVersion = metadataversion;
30 | }
31 |
32 | ///
33 | /// Gets the commit information.
34 | ///
35 | ///
36 | /// The commit.
37 | ///
38 | public string Commit { get; private set; }
39 |
40 | ///
41 | /// Gets a value indicating whether this is recovery firmware.
42 | ///
43 | ///
44 | /// true if recovery; otherwise, false.
45 | ///
46 | public bool IsRecovery { get; private set; }
47 |
48 | ///
49 | /// Gets the hardware platform.
50 | ///
51 | ///
52 | /// The hardware platform.
53 | ///
54 | public byte HardwarePlatform { get; private set; }
55 |
56 | ///
57 | /// Gets the metadata version.
58 | ///
59 | ///
60 | /// The metadata version.
61 | ///
62 | public byte MetadataVersion { get; private set; }
63 |
64 | ///
65 | /// Gets or sets the hardware revision.
66 | ///
67 | ///
68 | /// The hardware revision.
69 | ///
70 | public HardwareRevision HardwareRevision { get; set; }
71 |
72 | ///
73 | /// Returns a that represents this instance.
74 | ///
75 | ///
76 | /// A that represents this instance.
77 | ///
78 | public override string ToString()
79 | {
80 | string format = "Version {0}, commit {1} ({2})\n"
81 | + "Recovery: {3}\n"
82 | + "HW Platform: {4}\n"
83 | + "Metadata version: {5}";
84 | return string.Format(format, this.Version, this.Commit, this.Timestamp, this.IsRecovery, this.HardwarePlatform, this.MetadataVersion);
85 | }
86 |
87 | ///
88 | /// Gets the firmware server URL.
89 | ///
90 | /// if set to true [use nightly build].
91 | /// The url
92 | public string GetFirmwareServerUrl(bool useNightlyBuild = false)
93 | {
94 | return string.Format(URL, this.HardwareRevision.ToString(), useNightlyBuild ? "nightly" : "release");
95 | }
96 | }
97 | }
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using Windows.ApplicationModel;
6 | using Windows.ApplicationModel.Activation;
7 | using Windows.Foundation;
8 | using Windows.Foundation.Collections;
9 | using Windows.UI.Xaml;
10 | using Windows.UI.Xaml.Controls;
11 | using Windows.UI.Xaml.Controls.Primitives;
12 | using Windows.UI.Xaml.Data;
13 | using Windows.UI.Xaml.Input;
14 | using Windows.UI.Xaml.Media;
15 | using Windows.UI.Xaml.Navigation;
16 |
17 | // Die Vorlage "Leere Anwendung" ist unter http://go.microsoft.com/fwlink/?LinkId=234227 dokumentiert.
18 |
19 | namespace P3bbleWP8
20 | {
21 | ///
22 | /// Stellt das anwendungsspezifische Verhalten bereit, um die Standardanwendungsklasse zu ergänzen.
23 | ///
24 | sealed partial class App : Application
25 | {
26 | ///
27 | /// Initialisiert das Singletonanwendungsobjekt. Dies ist die erste Zeile von erstelltem Code
28 | /// und daher das logische Äquivalent von main() bzw. WinMain().
29 | ///
30 | public App()
31 | {
32 | this.InitializeComponent();
33 | this.Suspending += OnSuspending;
34 | }
35 |
36 | ///
37 | /// Wird aufgerufen, wenn die Anwendung durch den Endbenutzer normal gestartet wird. Weitere Einstiegspunkte
38 | /// werden verwendet, wenn die Anwendung zum Öffnen einer bestimmten Datei, zum Anzeigen
39 | /// von Suchergebnissen usw. gestartet wird.
40 | ///
41 | /// Details über Startanforderung und -prozess.
42 | protected override void OnLaunched(LaunchActivatedEventArgs args)
43 | {
44 | Frame rootFrame = Window.Current.Content as Frame;
45 |
46 | // App-Initialisierung nicht wiederholen, wenn das Fenster bereits Inhalte enthält.
47 | // Nur sicherstellen, dass das Fenster aktiv ist.
48 | if (rootFrame == null)
49 | {
50 | // Einen Rahmen erstellen, der als Navigationskontext fungiert und zum Parameter der ersten Seite navigieren
51 | rootFrame = new Frame();
52 |
53 | if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
54 | {
55 | //TODO: Zustand von zuvor angehaltener Anwendung laden
56 | }
57 |
58 | // Den Rahmen im aktuellen Fenster platzieren
59 | Window.Current.Content = rootFrame;
60 | }
61 |
62 | if (rootFrame.Content == null)
63 | {
64 | // Wenn der Navigationsstapel nicht wiederhergestellt wird, zur ersten Seite navigieren
65 | // und die neue Seite konfigurieren, indem die erforderlichen Informationen als Navigationsparameter
66 | // übergeben werden
67 | if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
68 | {
69 | throw new Exception("Failed to create initial page");
70 | }
71 | }
72 | // Sicherstellen, dass das aktuelle Fenster aktiv ist
73 | Window.Current.Activate();
74 | }
75 |
76 | ///
77 | /// Wird aufgerufen, wenn die Ausführung der Anwendung angehalten wird. Der Anwendungszustand wird gespeichert,
78 | /// ohne zu wissen, ob die Anwendung beendet oder fortgesetzt wird und die Speicherinhalte dabei
79 | /// unbeschädigt bleiben.
80 | ///
81 | /// Die Quelle der Anhalteanforderung.
82 | /// Details zur Anhalteanforderung.
83 | private void OnSuspending(object sender, SuspendingEventArgs e)
84 | {
85 | var deferral = e.SuspendingOperation.GetDeferral();
86 | //TODO: Anwendungszustand speichern und alle Hintergrundaktivitäten beenden
87 | deferral.Complete();
88 | }
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/P3bbleWinRT.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bbleWinRT", "P3bbleWinRT.csproj", "{34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bbleWinRT.Core", "..\P3bbleWinRT.Core\P3bbleWinRT.Core.csproj", "{FC39CA95-4125-418E-A0AB-3C1CF79689BC}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|ARM = Debug|ARM
12 | Debug|x64 = Debug|x64
13 | Debug|x86 = Debug|x86
14 | Release|Any CPU = Release|Any CPU
15 | Release|ARM = Release|ARM
16 | Release|x64 = Release|x64
17 | Release|x86 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
23 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|ARM.ActiveCfg = Debug|ARM
24 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|ARM.Build.0 = Debug|ARM
25 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|ARM.Deploy.0 = Debug|ARM
26 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|x64.ActiveCfg = Debug|x64
27 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|x64.Build.0 = Debug|x64
28 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|x64.Deploy.0 = Debug|x64
29 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|x86.ActiveCfg = Debug|x86
30 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|x86.Build.0 = Debug|x86
31 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|x86.Deploy.0 = Debug|x86
32 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
33 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|Any CPU.Build.0 = Release|Any CPU
34 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|Any CPU.Deploy.0 = Release|Any CPU
35 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|ARM.ActiveCfg = Release|ARM
36 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|ARM.Build.0 = Release|ARM
37 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|ARM.Deploy.0 = Release|ARM
38 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|x64.ActiveCfg = Release|x64
39 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|x64.Build.0 = Release|x64
40 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|x64.Deploy.0 = Release|x64
41 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|x86.ActiveCfg = Release|x86
42 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|x86.Build.0 = Release|x86
43 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|x86.Deploy.0 = Release|x86
44 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|ARM.ActiveCfg = Debug|ARM
47 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|ARM.Build.0 = Debug|ARM
48 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|x64.ActiveCfg = Debug|x64
49 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|x64.Build.0 = Debug|x64
50 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|x86.ActiveCfg = Debug|x86
51 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|x86.Build.0 = Debug|x86
52 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
53 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|Any CPU.Build.0 = Release|Any CPU
54 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|ARM.ActiveCfg = Release|ARM
55 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|ARM.Build.0 = Release|ARM
56 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|x64.ActiveCfg = Release|x64
57 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|x64.Build.0 = Release|x64
58 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|x86.ActiveCfg = Release|x86
59 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|x86.Build.0 = Release|x86
60 | EndGlobalSection
61 | GlobalSection(SolutionProperties) = preSolution
62 | HideSolutionNode = FALSE
63 | EndGlobalSection
64 | EndGlobal
65 |
--------------------------------------------------------------------------------
/src/Samples/P3bbleWinRT/MessageBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Windows.UI.Popups;
4 |
5 | namespace P3bbleWP8
6 | {
7 | ///
8 | /// Utility class to help compatibility with WP8
9 | ///
10 | internal class MessageBox
11 | {
12 | ///
13 | /// Represents a user's response to a message box.
14 | ///
15 | public enum WrappedMessageBoxResult
16 | {
17 | ///
18 | /// Represents No result
19 | ///
20 | None = 0,
21 |
22 | ///
23 | /// Represents OK result
24 | ///
25 | OK = 1,
26 |
27 | ///
28 | /// Represents Cancel result
29 | ///
30 | Cancel = 2
31 | }
32 |
33 | ///
34 | /// Specifies the buttons to include when you display a message box.
35 | ///
36 | public enum WrappedMessageBoxButton
37 | {
38 | ///
39 | /// Represents OK Button
40 | ///
41 | OK = 0,
42 |
43 | ///
44 | /// Represents Cancel Button
45 | ///
46 | OKCancel = 1,
47 | }
48 |
49 | ///
50 | /// Shows a message box.
51 | ///
52 | /// The message box text.
53 | /// The caption.
54 | /// The buttons.
55 | /// A Task containing the button clicked
56 | public static async Task Show(string messageBoxText, string caption, WrappedMessageBoxButton buttons)
57 | {
58 | WrappedMessageBoxResult result = WrappedMessageBoxResult.None;
59 | MessageDialog md;
60 |
61 | if (string.IsNullOrEmpty(caption))
62 | {
63 | md = new MessageDialog(messageBoxText);
64 | }
65 | else
66 | {
67 | md = new MessageDialog(messageBoxText, caption);
68 | }
69 |
70 | switch (buttons)
71 | {
72 | case WrappedMessageBoxButton.OK:
73 | md.Commands.Add(new UICommand("OK", new UICommandInvokedHandler((cmd) => result = WrappedMessageBoxResult.OK)));
74 | break;
75 |
76 | case WrappedMessageBoxButton.OKCancel:
77 | md.Commands.Add(new UICommand("OK", new UICommandInvokedHandler((cmd) => result = WrappedMessageBoxResult.OK)));
78 | md.Commands.Add(new UICommand("Cancel", new UICommandInvokedHandler((cmd) => result = WrappedMessageBoxResult.Cancel)));
79 | md.CancelCommandIndex = (uint)md.Commands.Count - 1;
80 | break;
81 | }
82 |
83 | await md.ShowAsync();
84 | return result;
85 | }
86 |
87 | ///
88 | /// Shows a message box.
89 | ///
90 | /// The message box text.
91 | /// The caption.
92 | /// A Task containing the button clicked
93 | public static Task Show(string messageBoxText, string caption)
94 | {
95 | return Show(messageBoxText, caption, WrappedMessageBoxButton.OK);
96 | }
97 |
98 | ///
99 | /// Shows a message box.
100 | ///
101 | /// The message box text.
102 | /// A Task containing the button clicked
103 | public static Task Show(string messageBoxText)
104 | {
105 | return Show(messageBoxText, null, WrappedMessageBoxButton.OK);
106 | }
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Helper/Util.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices;
6 |
7 | namespace P3bble.Helper
8 | {
9 | internal static class Util
10 | {
11 | private static DateTime _epoch = new DateTime(1970, 1, 1);
12 |
13 | public static DateTime AsDateTime(this int ts)
14 | {
15 | return _epoch.AddSeconds(ts);
16 | }
17 |
18 | public static int AsEpoch(this DateTime time)
19 | {
20 | return Convert.ToInt32((time - _epoch).TotalSeconds);
21 | }
22 |
23 | public static double DateTimeToTimeStamp(DateTime dateTime)
24 | {
25 | return (dateTime - new DateTime(1970, 1, 1).ToLocalTime()).TotalSeconds;
26 | }
27 |
28 | public static T AsStruct(this Stream fs) where T : struct
29 | {
30 | // Borrowed from http://stackoverflow.com/a/1936208 because BitConverter-ing all of this would be a pain
31 | #if NETFX_CORE && !WINDOWS_PHONE_APP
32 | byte[] buffer = new byte[Marshal.SizeOf()];
33 | #else
34 | byte[] buffer = new byte[Marshal.SizeOf(typeof(T))];
35 | #endif
36 | fs.Read(buffer, 0, buffer.Length);
37 | return AsStruct(buffer);
38 | }
39 |
40 | public static T AsStruct(this byte[] bytes) where T : struct
41 | {
42 | #if NETFX_CORE && !WINDOWS_PHONE_APP
43 | if (bytes.Count() != Marshal.SizeOf())
44 | #else
45 | if (bytes.Count() != Marshal.SizeOf(typeof(T)))
46 | #endif
47 | {
48 | throw new ArgumentException("Byte array does not match size of target type.");
49 | }
50 |
51 | T ret;
52 | GCHandle hdl = GCHandle.Alloc(bytes, GCHandleType.Pinned);
53 | try
54 | {
55 | #if NETFX_CORE && !WINDOWS_PHONE_APP
56 | ret = (T)Marshal.PtrToStructure(hdl.AddrOfPinnedObject());
57 | #else
58 | ret = (T)Marshal.PtrToStructure(hdl.AddrOfPinnedObject(), typeof(T));
59 | #endif
60 | }
61 | finally
62 | {
63 | hdl.Free();
64 | }
65 |
66 | return ret;
67 | }
68 |
69 | public static Version AsVersion(this string version)
70 | {
71 | return new Version(version.Remove(0, 1));
72 | }
73 |
74 | public static uint Crc32(this List data)
75 | {
76 | return CrcProcessBuffer(data);
77 | }
78 |
79 | private static uint CrcProcessBuffer(List data, uint crc = 0xffffffff)
80 | {
81 | int wordCount = data.Count / 4;
82 | if (data.Count % 4 != 0)
83 | {
84 | wordCount += 1;
85 | }
86 |
87 | for (int i = 0; i < wordCount; i++)
88 | {
89 | byte[] word = new byte[4];
90 | int len = Math.Min(data.Count - (i * 4), 4);
91 | data.CopyTo(i * 4, word, 4 - len, len);
92 | if (len < 4)
93 | {
94 | Array.Reverse(word);
95 | }
96 |
97 | crc = CrcProcessWord(word, crc);
98 | }
99 |
100 | return crc;
101 | }
102 |
103 | private static uint CrcProcessWord(byte[] data, uint crc = 0xffffffff)
104 | {
105 | const uint CRC_POLY = 0x04C11DB7;
106 | List dataArray = new List(data);
107 |
108 | crc = crc ^ BitConverter.ToUInt32(dataArray.ToArray(), 0);
109 |
110 | for (int i = 0; i < 32; i++)
111 | {
112 | if ((crc & 0x80000000) != 0)
113 | {
114 | crc = (crc << 1) ^ CRC_POLY;
115 | }
116 | else
117 | {
118 | crc = crc << 1;
119 | }
120 | }
121 |
122 | return crc & 0xffffffff;
123 | }
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/P3bbleMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using P3bble.Constants;
4 | using P3bble.Helper;
5 | using P3bble.Messages;
6 |
7 | namespace P3bble
8 | {
9 | ///
10 | /// The base message
11 | ///
12 | internal abstract class P3bbleMessage
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | /// The endpoint.
18 | public P3bbleMessage(Endpoint endpoint)
19 | {
20 | this.Endpoint = endpoint;
21 | }
22 |
23 | ///
24 | /// Gets the endpoint.
25 | ///
26 | ///
27 | /// The endpoint.
28 | ///
29 | public Endpoint Endpoint { get; private set; }
30 |
31 | ///
32 | /// Creates an incoming message.
33 | ///
34 | /// The endpoint.
35 | /// The payload.
36 | /// A specific message type
37 | public static P3bbleMessage CreateMessage(Endpoint endpoint, List payload)
38 | {
39 | P3bbleMessage frame = null;
40 |
41 | switch (endpoint)
42 | {
43 | case Endpoint.Ping:
44 | frame = new PingMessage();
45 | break;
46 |
47 | case Endpoint.Version:
48 | frame = new VersionMessage();
49 | break;
50 |
51 | case Endpoint.Time:
52 | frame = new TimeMessage();
53 | break;
54 |
55 | case Endpoint.Logs:
56 | frame = new LogsMessage();
57 | break;
58 |
59 | case Endpoint.AppManager:
60 | frame = new AppManagerMessage();
61 | break;
62 |
63 | case Endpoint.MusicControl:
64 | frame = new MusicMessage();
65 | break;
66 |
67 | case Endpoint.ApplicationMessage:
68 | frame = new AppMessage(endpoint);
69 | break;
70 |
71 | case Endpoint.PutBytes:
72 | frame = new PutBytesMessage();
73 | break;
74 | }
75 |
76 | if (frame != null)
77 | {
78 | frame.GetContentFromMessage(payload);
79 | }
80 |
81 | return frame;
82 | }
83 |
84 | ///
85 | /// Serialises a message into a byte representation ready for sending
86 | ///
87 | /// A byte array
88 | public byte[] ToBuffer()
89 | {
90 | List buf = new List();
91 |
92 | this.AddContentToMessage(buf);
93 |
94 | byte[] lengthBytes = ByteHelper.ConvertToByteArray(Convert.ToUInt16(buf.Count));
95 | byte[] endpointBytes = ByteHelper.ConvertToByteArray(Convert.ToUInt16(this.Endpoint));
96 |
97 | if (BitConverter.IsLittleEndian)
98 | {
99 | // Data is transmitted big-endian, so flip.
100 | Array.Reverse(lengthBytes);
101 | Array.Reverse(endpointBytes);
102 | }
103 |
104 | buf.Insert(0, lengthBytes[0]);
105 | buf.Insert(1, lengthBytes[1]);
106 | buf.Insert(2, endpointBytes[0]);
107 | buf.Insert(3, endpointBytes[1]);
108 |
109 | return buf.ToArray();
110 | }
111 |
112 | ///
113 | /// Allows descendant classes to add content to the outgoing message.
114 | ///
115 | /// The payload storage.
116 | protected abstract void AddContentToMessage(List payload);
117 |
118 | ///
119 | /// Extracts content for the incoming message.
120 | ///
121 | /// The payload.
122 | protected abstract void GetContentFromMessage(List payload);
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/ApplicationMetadata.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Runtime.InteropServices;
4 |
5 | namespace P3bble.Types
6 | {
7 | ///
8 | /// Represents details of an application
9 | ///
10 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
11 | [SuppressMessage("Microsoft.StyleCop.CSharp.OrderingRules", "SA1202:ElementsMustBeOrderedByAccess", Justification = "It's a structure deserialized from a stream")]
12 | public struct ApplicationMetadata
13 | {
14 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
15 | internal readonly string Header;
16 | [MarshalAs(UnmanagedType.U1)]
17 | internal readonly byte StructMajorVersion;
18 | [MarshalAs(UnmanagedType.U1)]
19 | internal readonly byte StructMinorVersion;
20 | [MarshalAs(UnmanagedType.U1)]
21 | internal readonly byte SdkMajorVersion;
22 | [MarshalAs(UnmanagedType.U1)]
23 | internal readonly byte SdkMinorVersion;
24 | [MarshalAs(UnmanagedType.U1)]
25 | internal readonly byte AppMajorVersion;
26 | [MarshalAs(UnmanagedType.U1)]
27 | internal readonly byte AppMinorVersion;
28 | [MarshalAs(UnmanagedType.U2)]
29 | internal readonly ushort Size;
30 | [MarshalAs(UnmanagedType.U4)]
31 | internal readonly uint Offset;
32 | [MarshalAs(UnmanagedType.U4)]
33 | internal readonly uint CRC;
34 |
35 | ///
36 | /// The application name
37 | ///
38 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
39 | public readonly string AppName;
40 |
41 | ///
42 | /// The company name
43 | ///
44 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
45 | public readonly string CompanyName;
46 |
47 | [MarshalAs(UnmanagedType.U4)]
48 | internal readonly uint IconResourceID;
49 | [MarshalAs(UnmanagedType.U4)]
50 | internal readonly uint SymbolTableAddress;
51 | [MarshalAs(UnmanagedType.U4)]
52 | internal readonly uint Flags;
53 | [MarshalAs(UnmanagedType.U4)]
54 | internal readonly uint RelocationListStart;
55 | [MarshalAs(UnmanagedType.U4)]
56 | internal readonly uint RelocationListItemCount;
57 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
58 | internal readonly byte[] UuidInternal;
59 |
60 | internal Version StructVersion
61 | {
62 | get
63 | {
64 | return new Version(string.Format("{0}.{1}", this.StructMajorVersion, this.StructMinorVersion));
65 | }
66 | }
67 |
68 | ///
69 | /// Gets the application version.
70 | ///
71 | ///
72 | /// The application version.
73 | ///
74 | public Version AppVersion
75 | {
76 | get
77 | {
78 | return new Version(string.Format("{0}.{1}", this.AppMajorVersion, this.AppMinorVersion));
79 | }
80 | }
81 |
82 | ///
83 | /// Gets the SDK version.
84 | ///
85 | ///
86 | /// The SDK version.
87 | ///
88 | public Version SdkVersion
89 | {
90 | get
91 | {
92 | return new Version(string.Format("{0}.{1}", this.SdkMajorVersion, this.SdkMinorVersion));
93 | }
94 | }
95 |
96 | ///
97 | /// Gets the application UUID.
98 | ///
99 | ///
100 | /// The UUID.
101 | ///
102 | public Guid Uuid
103 | {
104 | get
105 | {
106 | return new Guid(this.UuidInternal);
107 | }
108 | }
109 |
110 | ///
111 | /// Returns a that represents this instance.
112 | ///
113 | ///
114 | /// A that represents this instance.
115 | ///
116 | public override string ToString()
117 | {
118 | string format = "{0}, version {1}.{2} by {3}";
119 | return string.Format(format, this.AppName, this.AppMajorVersion, this.AppMinorVersion, this.CompanyName);
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/src/P3bble-S8.1.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30324.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bble", "Samples\P3bble-S8.1\P3bble.csproj", "{D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bble.Core-8.1", "P3bble.Core-S8.1\P3bble.Core-S8.1.csproj", "{F5894170-64DE-4859-AFF8-B4F01CBCAFB3}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bble.PCL", "P3bble.PCL\P3bble.PCL.csproj", "{76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Debug|ARM = Debug|ARM
16 | Debug|x64 = Debug|x64
17 | Debug|x86 = Debug|x86
18 | Release|Any CPU = Release|Any CPU
19 | Release|ARM = Release|ARM
20 | Release|x64 = Release|x64
21 | Release|x86 = Release|x86
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|Any CPU.ActiveCfg = Debug|ARM
25 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|Any CPU.Build.0 = Debug|ARM
26 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|Any CPU.Deploy.0 = Debug|ARM
27 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|ARM.ActiveCfg = Debug|ARM
28 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|ARM.Build.0 = Debug|ARM
29 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|ARM.Deploy.0 = Debug|ARM
30 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|x64.ActiveCfg = Debug|Any CPU
31 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|x86.ActiveCfg = Debug|x86
32 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|x86.Build.0 = Debug|x86
33 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|x86.Deploy.0 = Debug|x86
34 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|Any CPU.ActiveCfg = Release|ARM
35 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|Any CPU.Build.0 = Release|ARM
36 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|Any CPU.Deploy.0 = Release|ARM
37 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|ARM.ActiveCfg = Release|ARM
38 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|ARM.Build.0 = Release|ARM
39 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|ARM.Deploy.0 = Release|ARM
40 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|x64.ActiveCfg = Release|Any CPU
41 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|x86.ActiveCfg = Release|x86
42 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|x86.Build.0 = Release|x86
43 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|x86.Deploy.0 = Release|x86
44 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|ARM.ActiveCfg = Debug|ARM
47 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|ARM.Build.0 = Debug|ARM
48 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|x64.ActiveCfg = Debug|Any CPU
49 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|x86.ActiveCfg = Debug|x86
50 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|x86.Build.0 = Debug|x86
51 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
52 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|Any CPU.Build.0 = Release|Any CPU
53 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|ARM.ActiveCfg = Release|ARM
54 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|ARM.Build.0 = Release|ARM
55 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|x64.ActiveCfg = Release|Any CPU
56 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|x86.ActiveCfg = Release|x86
57 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|x86.Build.0 = Release|x86
58 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
59 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
60 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|ARM.ActiveCfg = Debug|Any CPU
61 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|x64.ActiveCfg = Debug|Any CPU
62 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|x86.ActiveCfg = Debug|Any CPU
63 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
64 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|Any CPU.Build.0 = Release|Any CPU
65 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|ARM.ActiveCfg = Release|Any CPU
66 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|x64.ActiveCfg = Release|Any CPU
67 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|x86.ActiveCfg = Release|Any CPU
68 | EndGlobalSection
69 | GlobalSection(SolutionProperties) = preSolution
70 | HideSolutionNode = FALSE
71 | EndGlobalSection
72 | EndGlobal
73 |
--------------------------------------------------------------------------------
/src/Samples/P3bble/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/src/P3bbleWinRT.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bbleWinRT", "Samples\P3bbleWinRT\P3bbleWinRT.csproj", "{34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bbleWinRT.Core", "P3bbleWinRT.Core\P3bbleWinRT.Core.csproj", "{FC39CA95-4125-418E-A0AB-3C1CF79689BC}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bble.PCL", "P3bble.PCL\P3bble.PCL.csproj", "{76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Debug|ARM = Debug|ARM
16 | Debug|x64 = Debug|x64
17 | Debug|x86 = Debug|x86
18 | Release|Any CPU = Release|Any CPU
19 | Release|ARM = Release|ARM
20 | Release|x64 = Release|x64
21 | Release|x86 = Release|x86
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|Any CPU.ActiveCfg = Debug|x64
25 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|Any CPU.Build.0 = Debug|x64
26 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|Any CPU.Deploy.0 = Debug|x64
27 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|ARM.ActiveCfg = Debug|ARM
28 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|ARM.Build.0 = Debug|ARM
29 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|ARM.Deploy.0 = Debug|ARM
30 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|x64.ActiveCfg = Debug|Any CPU
31 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|x86.ActiveCfg = Debug|x86
32 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|x86.Build.0 = Debug|x86
33 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Debug|x86.Deploy.0 = Debug|x86
34 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|Any CPU.ActiveCfg = Release|ARM
35 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|Any CPU.Build.0 = Release|ARM
36 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|Any CPU.Deploy.0 = Release|ARM
37 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|ARM.ActiveCfg = Release|ARM
38 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|ARM.Build.0 = Release|ARM
39 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|ARM.Deploy.0 = Release|ARM
40 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|x64.ActiveCfg = Release|Any CPU
41 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|x86.ActiveCfg = Release|x86
42 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|x86.Build.0 = Release|x86
43 | {34FD5655-AE7C-4728-9AEE-82BFD17DC2C1}.Release|x86.Deploy.0 = Release|x86
44 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|ARM.ActiveCfg = Debug|ARM
47 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|ARM.Build.0 = Debug|ARM
48 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|x64.ActiveCfg = Debug|Any CPU
49 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|x86.ActiveCfg = Debug|x86
50 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Debug|x86.Build.0 = Debug|x86
51 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
52 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|Any CPU.Build.0 = Release|Any CPU
53 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|ARM.ActiveCfg = Release|ARM
54 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|ARM.Build.0 = Release|ARM
55 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|x64.ActiveCfg = Release|Any CPU
56 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|x86.ActiveCfg = Release|x86
57 | {FC39CA95-4125-418E-A0AB-3C1CF79689BC}.Release|x86.Build.0 = Release|x86
58 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
59 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
60 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|ARM.ActiveCfg = Debug|Any CPU
61 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|x64.ActiveCfg = Debug|Any CPU
62 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|x86.ActiveCfg = Debug|Any CPU
63 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
64 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|Any CPU.Build.0 = Release|Any CPU
65 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|ARM.ActiveCfg = Release|Any CPU
66 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|x64.ActiveCfg = Release|Any CPU
67 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|x86.ActiveCfg = Release|Any CPU
68 | EndGlobalSection
69 | GlobalSection(SolutionProperties) = preSolution
70 | HideSolutionNode = FALSE
71 | EndGlobalSection
72 | EndGlobal
73 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/src/Samples/P3bble/Resources/AppResources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34003
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace P3bble.Resources {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | public class AppResources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal AppResources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | public static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("P3bble.Resources.AppResources", typeof(AppResources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | public static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized string similar to add.
65 | ///
66 | public static string AppBarButtonText {
67 | get {
68 | return ResourceManager.GetString("AppBarButtonText", resourceCulture);
69 | }
70 | }
71 |
72 | ///
73 | /// Looks up a localized string similar to Menu Item.
74 | ///
75 | public static string AppBarMenuItemText {
76 | get {
77 | return ResourceManager.GetString("AppBarMenuItemText", resourceCulture);
78 | }
79 | }
80 |
81 | ///
82 | /// Looks up a localized string similar to P3BBLE.
83 | ///
84 | public static string ApplicationTitle {
85 | get {
86 | return ResourceManager.GetString("ApplicationTitle", resourceCulture);
87 | }
88 | }
89 |
90 | ///
91 | /// Looks up a localized string similar to LeftToRight.
92 | ///
93 | public static string ResourceFlowDirection {
94 | get {
95 | return ResourceManager.GetString("ResourceFlowDirection", resourceCulture);
96 | }
97 | }
98 |
99 | ///
100 | /// Looks up a localized string similar to en-US.
101 | ///
102 | public static string ResourceLanguage {
103 | get {
104 | return ResourceManager.GetString("ResourceLanguage", resourceCulture);
105 | }
106 | }
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Resources/AppResources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34011
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace P3bble.Resources {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | public class AppResources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal AppResources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | public static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("P3bble.Resources.AppResources", typeof(AppResources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | public static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized string similar to add.
65 | ///
66 | public static string AppBarButtonText {
67 | get {
68 | return ResourceManager.GetString("AppBarButtonText", resourceCulture);
69 | }
70 | }
71 |
72 | ///
73 | /// Looks up a localized string similar to Menu Item.
74 | ///
75 | public static string AppBarMenuItemText {
76 | get {
77 | return ResourceManager.GetString("AppBarMenuItemText", resourceCulture);
78 | }
79 | }
80 |
81 | ///
82 | /// Looks up a localized string similar to P3BBLE.
83 | ///
84 | public static string ApplicationTitle {
85 | get {
86 | return ResourceManager.GetString("ApplicationTitle", resourceCulture);
87 | }
88 | }
89 |
90 | ///
91 | /// Looks up a localized string similar to LeftToRight.
92 | ///
93 | public static string ResourceFlowDirection {
94 | get {
95 | return ResourceManager.GetString("ResourceFlowDirection", resourceCulture);
96 | }
97 | }
98 |
99 | ///
100 | /// Looks up a localized string similar to en-US.
101 | ///
102 | public static string ResourceLanguage {
103 | get {
104 | return ResourceManager.GetString("ResourceLanguage", resourceCulture);
105 | }
106 | }
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/src/P3bble.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bble", "Samples\P3bble\P3bble.csproj", "{D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bble.Core", "P3bble.Core\P3bble.Core.csproj", "{F5894170-64DE-4859-AFF8-B4F01CBCAFB3}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{E475E16D-B561-40F2-8D0E-1F832C0F884B}"
11 | ProjectSection(SolutionItems) = preProject
12 | .nuget\NuGet.Config = .nuget\NuGet.Config
13 | .nuget\NuGet.exe = .nuget\NuGet.exe
14 | .nuget\NuGet.targets = .nuget\NuGet.targets
15 | EndProjectSection
16 | EndProject
17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bble.PCL", "P3bble.PCL\P3bble.PCL.csproj", "{76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}"
18 | EndProject
19 | Global
20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
21 | Debug|Any CPU = Debug|Any CPU
22 | Debug|ARM = Debug|ARM
23 | Debug|x64 = Debug|x64
24 | Debug|x86 = Debug|x86
25 | Release|Any CPU = Release|Any CPU
26 | Release|ARM = Release|ARM
27 | Release|x64 = Release|x64
28 | Release|x86 = Release|x86
29 | EndGlobalSection
30 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
31 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|Any CPU.ActiveCfg = Debug|ARM
32 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|Any CPU.Build.0 = Debug|ARM
33 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|Any CPU.Deploy.0 = Debug|ARM
34 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|ARM.ActiveCfg = Debug|ARM
35 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|ARM.Build.0 = Debug|ARM
36 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|ARM.Deploy.0 = Debug|ARM
37 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|x64.ActiveCfg = Debug|Any CPU
38 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|x86.ActiveCfg = Debug|x86
39 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|x86.Build.0 = Debug|x86
40 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Debug|x86.Deploy.0 = Debug|x86
41 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|Any CPU.ActiveCfg = Release|ARM
42 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|Any CPU.Build.0 = Release|ARM
43 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|Any CPU.Deploy.0 = Release|ARM
44 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|ARM.ActiveCfg = Release|ARM
45 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|ARM.Build.0 = Release|ARM
46 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|ARM.Deploy.0 = Release|ARM
47 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|x64.ActiveCfg = Release|Any CPU
48 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|x86.ActiveCfg = Release|x86
49 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|x86.Build.0 = Release|x86
50 | {D9F5B064-FB66-49D5-9C2A-097BD85EBCCB}.Release|x86.Deploy.0 = Release|x86
51 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
53 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|ARM.ActiveCfg = Debug|ARM
54 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|ARM.Build.0 = Debug|ARM
55 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|x64.ActiveCfg = Debug|Any CPU
56 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|x86.ActiveCfg = Debug|x86
57 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Debug|x86.Build.0 = Debug|x86
58 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
59 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|Any CPU.Build.0 = Release|Any CPU
60 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|ARM.ActiveCfg = Release|ARM
61 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|ARM.Build.0 = Release|ARM
62 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|x64.ActiveCfg = Release|Any CPU
63 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|x86.ActiveCfg = Release|x86
64 | {F5894170-64DE-4859-AFF8-B4F01CBCAFB3}.Release|x86.Build.0 = Release|x86
65 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
66 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
67 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|ARM.ActiveCfg = Debug|Any CPU
68 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|x64.ActiveCfg = Debug|Any CPU
69 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|x86.ActiveCfg = Debug|Any CPU
70 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
71 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|Any CPU.Build.0 = Release|Any CPU
72 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|ARM.ActiveCfg = Release|Any CPU
73 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|x64.ActiveCfg = Release|Any CPU
74 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|x86.ActiveCfg = Release|Any CPU
75 | EndGlobalSection
76 | GlobalSection(SolutionProperties) = preSolution
77 | HideSolutionNode = FALSE
78 | EndGlobalSection
79 | EndGlobal
80 |
--------------------------------------------------------------------------------
/src/P3bble-8.1.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30324.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{E475E16D-B561-40F2-8D0E-1F832C0F884B}"
7 | ProjectSection(SolutionItems) = preProject
8 | .nuget\NuGet.Config = .nuget\NuGet.Config
9 | .nuget\NuGet.exe = .nuget\NuGet.exe
10 | .nuget\NuGet.targets = .nuget\NuGet.targets
11 | EndProjectSection
12 | EndProject
13 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bble.PCL", "P3bble.PCL\P3bble.PCL.csproj", "{76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}"
14 | EndProject
15 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bble-8.1", "Samples\P3bble-8.1\P3bble-8.1.csproj", "{91AE1772-4BB4-4215-A5A7-3C42893BEFE4}"
16 | EndProject
17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P3bble.Core-8.1", "P3bble.Core-8.1\P3bble.Core-8.1.csproj", "{72E5AA0E-3986-42D2-B048-324DC046DD75}"
18 | EndProject
19 | Global
20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
21 | Debug|Any CPU = Debug|Any CPU
22 | Debug|ARM = Debug|ARM
23 | Debug|x64 = Debug|x64
24 | Debug|x86 = Debug|x86
25 | Release|Any CPU = Release|Any CPU
26 | Release|ARM = Release|ARM
27 | Release|x64 = Release|x64
28 | Release|x86 = Release|x86
29 | EndGlobalSection
30 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
31 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
33 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|ARM.ActiveCfg = Debug|Any CPU
34 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|x64.ActiveCfg = Debug|Any CPU
35 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Debug|x86.ActiveCfg = Debug|Any CPU
36 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
37 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|Any CPU.Build.0 = Release|Any CPU
38 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|ARM.ActiveCfg = Release|Any CPU
39 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|x64.ActiveCfg = Release|Any CPU
40 | {76E03460-2CD0-4580-ADA0-A5FE68CB7E1C}.Release|x86.ActiveCfg = Release|Any CPU
41 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
43 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
44 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Debug|ARM.ActiveCfg = Debug|ARM
45 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Debug|ARM.Build.0 = Debug|ARM
46 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Debug|ARM.Deploy.0 = Debug|ARM
47 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Debug|x64.ActiveCfg = Debug|Any CPU
48 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Debug|x86.ActiveCfg = Debug|x86
49 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Debug|x86.Build.0 = Debug|x86
50 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Debug|x86.Deploy.0 = Debug|x86
51 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
52 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Release|Any CPU.Build.0 = Release|Any CPU
53 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Release|Any CPU.Deploy.0 = Release|Any CPU
54 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Release|ARM.ActiveCfg = Release|ARM
55 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Release|ARM.Build.0 = Release|ARM
56 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Release|ARM.Deploy.0 = Release|ARM
57 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Release|x64.ActiveCfg = Release|Any CPU
58 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Release|x86.ActiveCfg = Release|x86
59 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Release|x86.Build.0 = Release|x86
60 | {91AE1772-4BB4-4215-A5A7-3C42893BEFE4}.Release|x86.Deploy.0 = Release|x86
61 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Debug|Any CPU.Build.0 = Debug|Any CPU
63 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Debug|ARM.ActiveCfg = Debug|ARM
64 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Debug|ARM.Build.0 = Debug|ARM
65 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Debug|x64.ActiveCfg = Debug|Any CPU
66 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Debug|x86.ActiveCfg = Debug|x86
67 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Debug|x86.Build.0 = Debug|x86
68 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Release|Any CPU.ActiveCfg = Release|Any CPU
69 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Release|Any CPU.Build.0 = Release|Any CPU
70 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Release|ARM.ActiveCfg = Release|ARM
71 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Release|ARM.Build.0 = Release|ARM
72 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Release|x64.ActiveCfg = Release|Any CPU
73 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Release|x86.ActiveCfg = Release|x86
74 | {72E5AA0E-3986-42D2-B048-324DC046DD75}.Release|x86.Build.0 = Release|x86
75 | EndGlobalSection
76 | GlobalSection(SolutionProperties) = preSolution
77 | HideSolutionNode = FALSE
78 | EndGlobalSection
79 | EndGlobal
80 |
--------------------------------------------------------------------------------
/src/P3bble.Core/Types/VersionInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 | using P3bble.Helper;
4 |
5 | namespace P3bble.Types
6 | {
7 | ///
8 | /// Version information
9 | ///
10 | [DataContract]
11 | public abstract class VersionInfo : IComparable
12 | {
13 | ///
14 | /// Gets the timestamp.
15 | ///
16 | ///
17 | /// The timestamp.
18 | ///
19 | public DateTime Timestamp
20 | {
21 | get
22 | {
23 | return this.TimestampInternal.AsDateTime();
24 | }
25 | }
26 |
27 | ///
28 | /// Gets the version.
29 | ///
30 | ///
31 | /// The version.
32 | ///
33 | public Version Version
34 | {
35 | get
36 | {
37 | return this.VersionInternal.AsVersion();
38 | }
39 | }
40 |
41 | [DataMember(Name = "timestamp", IsRequired = true)]
42 | internal int TimestampInternal { get; set; }
43 |
44 | [DataMember(Name = "friendlyVersion", IsRequired = false)]
45 | internal string VersionInternal { get; set; }
46 |
47 | ///
48 | /// Determines whether one specified P3bbleVersion is greater than another specified P3bbleVersion.
49 | ///
50 | /// The first object to compare.
51 | /// The second object to compare.
52 | /// true if v1 is greater than v2; otherwise, false.
53 | public static bool operator >(VersionInfo v1, VersionInfo v2)
54 | {
55 | return v1 != null && v2 != null && v1.Version > v2.Version;
56 | }
57 |
58 | ///
59 | /// Determines whether one specified P3bbleVersion is less than another specified P3bbleVersion.
60 | ///
61 | /// The first object to compare.
62 | /// The second object to compare.
63 | /// true if v1 is less than v2; otherwise, false.
64 | public static bool operator <(VersionInfo v1, VersionInfo v2)
65 | {
66 | return v1 != null && v2 != null && v1.Version < v2.Version;
67 | }
68 |
69 | ///
70 | /// Determines whether one specified P3bbleVersion is equal to another specified P3bbleVersion.
71 | ///
72 | /// The first object to compare.
73 | /// The second object to compare.
74 | /// true if v1 is equal to v2; otherwise, false.
75 | public static bool operator ==(VersionInfo v1, VersionInfo v2)
76 | {
77 | return v1.Equals(v2);
78 | }
79 |
80 | ///
81 | /// Determines whether one specified P3bbleVersion is not equal to another specified P3bbleVersion.
82 | ///
83 | /// The first object to compare.
84 | /// The second object to compare.
85 | /// true if v1 is not equal to v2; otherwise, false.
86 | public static bool operator !=(VersionInfo v1, VersionInfo v2)
87 | {
88 | return !v1.Equals(v2);
89 | }
90 |
91 | ///
92 | /// Compares the current object with another object of the same type.
93 | ///
94 | /// An object to compare with this object.
95 | ///
96 | /// A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the parameter.Zero This object is equal to . Greater than zero This object is greater than .
97 | ///
98 | public int CompareTo(VersionInfo other)
99 | {
100 | return this.Version.CompareTo(other.Version);
101 | }
102 |
103 | ///
104 | /// Determines whether the specified , is equal to this instance.
105 | ///
106 | /// The to compare with this instance.
107 | ///
108 | /// true if the specified is equal to this instance; otherwise, false.
109 | ///
110 | public override bool Equals(object obj)
111 | {
112 | var ver = obj as VersionInfo;
113 | if (obj != null)
114 | {
115 | return this.Version == ver.Version;
116 | }
117 | else
118 | {
119 | return false;
120 | }
121 | }
122 |
123 | ///
124 | /// Returns a hash code for this instance.
125 | ///
126 | ///
127 | /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
128 | ///
129 | public override int GetHashCode()
130 | {
131 | return this.Version.GetHashCode();
132 | }
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-8.1/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using P3bble.Core;
2 | using P3bble.PCL;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Runtime.InteropServices.WindowsRuntime;
8 | using Windows.ApplicationModel;
9 | using Windows.ApplicationModel.Activation;
10 | using Windows.Foundation;
11 | using Windows.Foundation.Collections;
12 | using Windows.UI.Xaml;
13 | using Windows.UI.Xaml.Controls;
14 | using Windows.UI.Xaml.Controls.Primitives;
15 | using Windows.UI.Xaml.Data;
16 | using Windows.UI.Xaml.Input;
17 | using Windows.UI.Xaml.Media;
18 | using Windows.UI.Xaml.Media.Animation;
19 | using Windows.UI.Xaml.Navigation;
20 |
21 | // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=391641
22 |
23 | namespace P3bble
24 | {
25 | ///
26 | /// Provides application-specific behavior to supplement the default Application class.
27 | ///
28 | public sealed partial class App : Application
29 | {
30 | private TransitionCollection transitions;
31 |
32 | ///
33 | /// Initializes the singleton application object. This is the first line of authored code
34 | /// executed, and as such is the logical equivalent of main() or WinMain().
35 | ///
36 | public App()
37 | {
38 | this.InitializeComponent();
39 | this.Suspending += this.OnSuspending;
40 |
41 | ServiceLocator.Logger = new Logger();
42 | }
43 |
44 | ///
45 | /// Invoked when the application is launched normally by the end user. Other entry points
46 | /// will be used when the application is launched to open a specific file, to display
47 | /// search results, and so forth.
48 | ///
49 | /// Details about the launch request and process.
50 | protected override void OnLaunched(LaunchActivatedEventArgs e)
51 | {
52 | #if DEBUG
53 | if (System.Diagnostics.Debugger.IsAttached)
54 | {
55 | this.DebugSettings.EnableFrameRateCounter = true;
56 | }
57 | #endif
58 |
59 | Frame rootFrame = Window.Current.Content as Frame;
60 |
61 | // Do not repeat app initialization when the Window already has content,
62 | // just ensure that the window is active
63 | if (rootFrame == null)
64 | {
65 | // Create a Frame to act as the navigation context and navigate to the first page
66 | rootFrame = new Frame();
67 |
68 | // TODO: change this value to a cache size that is appropriate for your application
69 | rootFrame.CacheSize = 1;
70 |
71 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
72 | {
73 | // TODO: Load state from previously suspended application
74 | }
75 |
76 | // Place the frame in the current Window
77 | Window.Current.Content = rootFrame;
78 | }
79 |
80 | if (rootFrame.Content == null)
81 | {
82 | // Removes the turnstile navigation for startup.
83 | if (rootFrame.ContentTransitions != null)
84 | {
85 | this.transitions = new TransitionCollection();
86 | foreach (var c in rootFrame.ContentTransitions)
87 | {
88 | this.transitions.Add(c);
89 | }
90 | }
91 |
92 | rootFrame.ContentTransitions = null;
93 | rootFrame.Navigated += this.RootFrame_FirstNavigated;
94 |
95 | // When the navigation stack isn't restored navigate to the first page,
96 | // configuring the new page by passing required information as a navigation
97 | // parameter
98 | if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
99 | {
100 | throw new Exception("Failed to create initial page");
101 | }
102 | }
103 |
104 | // Ensure the current window is active
105 | Window.Current.Activate();
106 | }
107 |
108 | ///
109 | /// Restores the content transitions after the app has launched.
110 | ///
111 | /// The object where the handler is attached.
112 | /// Details about the navigation event.
113 | private void RootFrame_FirstNavigated(object sender, NavigationEventArgs e)
114 | {
115 | var rootFrame = sender as Frame;
116 | rootFrame.ContentTransitions = this.transitions ?? new TransitionCollection() { new NavigationThemeTransition() };
117 | rootFrame.Navigated -= this.RootFrame_FirstNavigated;
118 | }
119 |
120 | ///
121 | /// Invoked when application execution is being suspended. Application state is saved
122 | /// without knowing whether the application will be terminated or resumed with the contents
123 | /// of memory still intact.
124 | ///
125 | /// The source of the suspend request.
126 | /// Details about the suspend request.
127 | private void OnSuspending(object sender, SuspendingEventArgs e)
128 | {
129 | var deferral = e.SuspendingOperation.GetDeferral();
130 |
131 | // TODO: Save application state and stop any background activity
132 | deferral.Complete();
133 | }
134 | }
135 | }
--------------------------------------------------------------------------------
/src/P3bble.Core/Messages/AppMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using P3bble.Constants;
6 |
7 | namespace P3bble.Messages
8 | {
9 | ///
10 | /// Application command
11 | ///
12 | internal enum AppCommand : byte
13 | {
14 | ///
15 | /// The push response
16 | ///
17 | Push = 1,
18 |
19 | ///
20 | /// The request response
21 | ///
22 | Request = 2,
23 |
24 | ///
25 | /// The finalise install command
26 | ///
27 | FinaliseInstall = 3,
28 |
29 | ///
30 | /// The ack response
31 | ///
32 | Ack = 0xff,
33 |
34 | ///
35 | /// The nack response
36 | ///
37 | Nack = 0x7f
38 | }
39 |
40 | ///
41 | /// Application Message Data Types
42 | ///
43 | internal enum AppMessageTupleDataType : byte
44 | {
45 | ///
46 | /// A byte array
47 | ///
48 | ByteArray = 0,
49 |
50 | ///
51 | /// A string
52 | ///
53 | String = 1,
54 |
55 | ///
56 | /// An unsigned integer
57 | ///
58 | UInt = 2,
59 |
60 | ///
61 | /// An integer
62 | ///
63 | Int = 3
64 | }
65 |
66 | ///
67 | /// Launcher keys
68 | ///
69 | internal enum LauncherKeys : byte
70 | {
71 | ///
72 | /// The run state key
73 | ///
74 | RunState = 1
75 | }
76 |
77 | ///
78 | /// Application launch param
79 | ///
80 | internal enum LauncherParams : byte
81 | {
82 | ///
83 | /// The not running state
84 | ///
85 | NotRunning = 0,
86 |
87 | ///
88 | /// The running state
89 | ///
90 | Running = 1
91 | }
92 |
93 | internal class AppMessage : P3bbleMessage
94 | {
95 | internal const byte RunState = 1;
96 |
97 | private List _tuples = new List();
98 |
99 | public AppMessage()
100 | : this(Endpoint.ApplicationMessage)
101 | {
102 | }
103 |
104 | public AppMessage(Endpoint messageType)
105 | : base(messageType)
106 | {
107 | }
108 |
109 | public Guid AppUuid { get; set; }
110 |
111 | public AppCommand Command { get; set; }
112 |
113 | public uint AppIndex { get; set; }
114 |
115 | ///
116 | /// Gets or sets the remaining response.
117 | ///
118 | ///
119 | /// The remaining response.
120 | ///
121 | /// Not expecting this to get used
122 | private byte[] RemainingResponse { get; set; }
123 |
124 | public void AddTuple(uint key, AppMessageTupleDataType dataType, byte data)
125 | {
126 | this.AddTuple(key, dataType, new byte[] { data });
127 | }
128 |
129 | public void AddTuple(uint key, AppMessageTupleDataType dataType, byte[] data)
130 | {
131 | List result = new List();
132 |
133 | byte[] keyBytes = BitConverter.GetBytes(key);
134 | byte[] lengthBytes = BitConverter.GetBytes((short)data.Length);
135 |
136 | result.AddRange(keyBytes);
137 | result.Add((byte)dataType);
138 | result.AddRange(lengthBytes);
139 | result.AddRange(data);
140 |
141 | this._tuples.Add(result.ToArray());
142 | }
143 |
144 | protected override void AddContentToMessage(List payload)
145 | {
146 | // Add the command
147 | payload.Add((byte)this.Command);
148 |
149 | if (this.Command == AppCommand.FinaliseInstall)
150 | {
151 | byte[] indexBytes = BitConverter.GetBytes(this.AppIndex);
152 | if (BitConverter.IsLittleEndian)
153 | {
154 | Array.Reverse(indexBytes);
155 | }
156 |
157 | payload.AddRange(indexBytes);
158 | }
159 | else
160 | {
161 | List data = new List();
162 |
163 | // Add a transaction id:
164 | data.Add(0);
165 |
166 | // Add the app id:
167 | data.AddRange(this.AppUuid.ToByteArray());
168 |
169 | // Add the actual data to send - first the count...
170 | data.Add((byte)(this._tuples.Count * 4));
171 |
172 | // Now the tuples...
173 | foreach (var tuple in this._tuples)
174 | {
175 | data.AddRange(tuple);
176 | }
177 |
178 | payload.AddRange(data);
179 | }
180 | }
181 |
182 | protected override void GetContentFromMessage(List payload)
183 | {
184 | if (payload.Count > 0)
185 | {
186 | switch (payload[0])
187 | {
188 | case (byte)AppCommand.Push:
189 | case (byte)AppCommand.Request:
190 | case (byte)AppCommand.Ack:
191 | case (byte)AppCommand.Nack:
192 |
193 | this.Command = (AppCommand)payload[0];
194 | break;
195 |
196 | default:
197 | break;
198 | }
199 |
200 | if (payload.Count > 1)
201 | {
202 | this.RemainingResponse = new byte[payload.Count - 1];
203 | payload.CopyTo(1, this.RemainingResponse, 0, payload.Count - 1);
204 | }
205 | }
206 | }
207 | }
208 | }
209 |
--------------------------------------------------------------------------------
/src/Samples/P3bble/Resources/AppResources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | LeftToRight
122 | Controls the FlowDirection for all elements in the RootFrame. Set to the traditional direction of this resource file's language
123 |
124 |
125 | en-US
126 | Controls the Language and ensures that the font for all elements in the RootFrame aligns with the app's language. Set to the language code of this resource file's language.
127 |
128 |
129 | P3BBLE
130 |
131 |
132 | add
133 |
134 |
135 | Menu Item
136 |
137 |
--------------------------------------------------------------------------------
/src/Samples/P3bble-S8.1/Resources/AppResources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | LeftToRight
122 | Controls the FlowDirection for all elements in the RootFrame. Set to the traditional direction of this resource file's language
123 |
124 |
125 | en-US
126 | Controls the Language and ensures that the font for all elements in the RootFrame aligns with the app's language. Set to the language code of this resource file's language.
127 |
128 |
129 | P3BBLE
130 |
131 |
132 | add
133 |
134 |
135 | Menu Item
136 |
137 |
--------------------------------------------------------------------------------