Skip to content

Commit

Permalink
Windows 10 RTM Release - August 2016 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnewthing committed Aug 3, 2016
1 parent 4fde342 commit ef073ed
Show file tree
Hide file tree
Showing 43 changed files with 1,709 additions and 70 deletions.
44 changes: 22 additions & 22 deletions Samples/AllJoyn/ConsumerExperiences/cs/Scenario2ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Input;
using Windows.Devices.AllJoyn;
Expand Down Expand Up @@ -59,13 +60,12 @@ class Scenario2ViewModel : INotifyPropertyChanged
private bool? m_physicalDeviceIsChecked = null;
private bool m_showOnboardeeSsidList = true;
private bool m_showOnboarderSsidList = false;
private bool m_isAuthenticated = false;
private bool m_isCredentialsRequested = false;
private AllJoynBusAttachment m_busAttachment = null;
private OnboardingWatcher m_watcher = null;
private OnboardingConsumer m_consumer = null;
private OnboardingAuthenticationType m_selectedAuthType = OnboardingAuthenticationType.Any;
private TaskCompletionSource<bool> m_authenticateClicked = null;
private int m_onboardSessionAlreadyJoined;

public Scenario2ViewModel()
{
Expand Down Expand Up @@ -681,9 +681,13 @@ private void ScanForOnboardingInterfaces()
{
ScenarioCleanup();

// Allow re-joining of a new session
Interlocked.Exchange(ref m_onboardSessionAlreadyJoined, 0);

m_busAttachment = new AllJoynBusAttachment();
m_busAttachment.StateChanged += BusAttachment_StateChanged;
m_busAttachment.AuthenticationMechanisms.Clear();
m_busAttachment.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.EcdheNull);
m_busAttachment.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.EcdhePsk);
m_busAttachment.AuthenticationComplete += BusAttachment_AuthenticationComplete;
m_busAttachment.CredentialsRequested += BusAttachment_CredentialsRequested;
Expand Down Expand Up @@ -713,15 +717,13 @@ private void BusAttachment_AuthenticationComplete(AllJoynBusAttachment sender, A
UpdateStatusAsync("Authentication failed.", NotifyType.ErrorMessage);
}

m_isAuthenticated = args.Succeeded;
EnteredKey = "";
AuthenticationVisibility = Visibility.Collapsed;
}

private async void BusAttachment_CredentialsRequested(AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
{
Windows.Foundation.Deferral credentialsDeferral = args.GetDeferral();
m_isCredentialsRequested = true;

if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdhePsk)
{
Expand All @@ -741,6 +743,9 @@ private async void BusAttachment_CredentialsRequested(AllJoynBusAttachment sende
UpdateStatusAsync("Please enter a key.", NotifyType.ErrorMessage);
}
}
else if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdheNull)
{
}
else
{
UpdateStatusAsync("Unexpected authentication mechanism.", NotifyType.ErrorMessage);
Expand All @@ -751,18 +756,25 @@ private async void BusAttachment_CredentialsRequested(AllJoynBusAttachment sende

private async void Watcher_Added(OnboardingWatcher sender, AllJoynServiceInfo args)
{
// This demo supports a single onboarding producer, if there are multiple onboarding producers found, then they are ignored.
// Another approach would be to create a list of all producers found and then allow the user to choose the one they want
bool bAlreadyJoined = (Interlocked.CompareExchange(ref m_onboardSessionAlreadyJoined, 1, 0) == 1);
if (bAlreadyJoined)
{
return;
}

UpdateStatusAsync("Joining session...", NotifyType.StatusMessage);

OnboardingJoinSessionResult joinSessionResult = await OnboardingConsumer.JoinSessionAsync(args, sender);
if (joinSessionResult.Status == AllJoynStatus.Ok)
{
UpdateStatusAsync("Session Joined.", NotifyType.ErrorMessage);
DisposeConsumer();
m_consumer = joinSessionResult.Consumer;
m_consumer.SessionLost += Consumer_SessionLost;

if (!m_isCredentialsRequested || m_isAuthenticated)
{
GetOnboardeeNetworkListAsync();
}
GetOnboardeeNetworkListAsync();
}
else
{
Expand Down Expand Up @@ -869,8 +881,8 @@ private async void AttemptOnboardingAsync(string ssid, string password, short au
else
{
UpdateStatusAsync("Attempting to configure onboardee...", NotifyType.StatusMessage);
// WiFi password must be converted to hex representation of the UTF-8 string.
OnboardingConfigureWiFiResult configureWifiResult = await m_consumer.ConfigureWiFiAsync(ssid, ConvertUtf8ToHex(password), authType);

OnboardingConfigureWiFiResult configureWifiResult = await m_consumer.ConfigureWiFiAsync(ssid, password, authType);
if (configureWifiResult.Status == AllJoynStatus.Ok)
{
UpdateStatusAsync("Onboardee sucessfully configured.", NotifyType.StatusMessage);
Expand Down Expand Up @@ -912,18 +924,6 @@ private void Signals_ConnectionResultReceived(OnboardingSignals sender, Onboardi
}
}

private string ConvertUtf8ToHex(string inputString)
{
if (string.IsNullOrEmpty(inputString))
{
return string.Empty;
}
else
{
return BitConverter.ToString(Encoding.UTF8.GetBytes(inputString)).Replace("-", string.Empty);
}
}

private void ClearPasswords()
{
SoftAPPassword = "";
Expand Down
14 changes: 1 addition & 13 deletions Samples/AllJoyn/ProducerExperiences/cs/Scenario2ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private async void OnboardingService_ConnectRequestRecieved(object sender, Event
}
else
{
if (AppData.OnboardingConfigurePassphrase.Equals(ConvertUtf8ToHex(AppData.SampleNetworkPassword), StringComparison.OrdinalIgnoreCase))
if (AppData.OnboardingConfigurePassphrase.Equals(AppData.SampleNetworkPassword, StringComparison.OrdinalIgnoreCase))
{
returnArg.Value1 = (short)ConnectionResultCode.Validated;
returnArg.Value2 = "Connected successfully";
Expand Down Expand Up @@ -377,18 +377,6 @@ private async void OnboardingService_ConnectRequestRecieved(object sender, Event
}
}

private string ConvertUtf8ToHex(string inputString)
{
if (string.IsNullOrEmpty(inputString))
{
return string.Empty;
}
else
{
return BitConverter.ToString(Encoding.UTF8.GetBytes(inputString)).Replace("-", string.Empty);
}
}

private async void UpdateStatusAsync(string status, NotifyType statusType)
{
await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
Expand Down
40 changes: 40 additions & 0 deletions Samples/Notifications/js/Notifications.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "Notifications", "Notifications\Notifications.jsproj", "{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Debug|ARM.ActiveCfg = Debug|ARM
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Debug|ARM.Build.0 = Debug|ARM
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Debug|ARM.Deploy.0 = Debug|ARM
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Debug|x64.ActiveCfg = Debug|x64
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Debug|x64.Build.0 = Debug|x64
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Debug|x64.Deploy.0 = Debug|x64
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Debug|x86.ActiveCfg = Debug|x86
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Debug|x86.Build.0 = Debug|x86
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Debug|x86.Deploy.0 = Debug|x86
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Release|ARM.ActiveCfg = Release|ARM
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Release|ARM.Build.0 = Release|ARM
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Release|ARM.Deploy.0 = Release|ARM
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Release|x64.ActiveCfg = Release|x64
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Release|x64.Build.0 = Release|x64
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Release|x64.Deploy.0 = Release|x64
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Release|x86.ActiveCfg = Release|x86
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Release|x86.Build.0 = Release|x86
{0DBEEE91-BC29-40A6-B02D-3754DA6C1A72}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Empty file.
Empty file.
Empty file.
183 changes: 183 additions & 0 deletions Samples/Notifications/js/Notifications/Notifications.jsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>0dbeee91-bc29-40a6-b02d-3754da6c1a72</ProjectGuid>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0'">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" />
<PropertyGroup>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>$(VersionNumberMajor).$(VersionNumberMinor)</MinimumVisualStudioVersion>
<DefaultLanguage>en-US</DefaultLanguage>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<Content Include="..\..\..\..\SharedContent\js\default.html">
<Link>default.html</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\js\default.js">
<Link>js\default.js</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\css\default.css">
<Link>css\default.css</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\Microsoft.WinJS\css\ui-dark.css">
<Link>Microsoft.WinJS.4.0\css\ui-dark.css</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\Microsoft.WinJS\css\ui-light.css">
<Link>Microsoft.WinJS.4.0\css\ui-light.css</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\Microsoft.WinJS\js\en-US\ui.strings.js">
<Link>Microsoft.WinJS.4.0\js\en-US\ui.strings.js</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\Microsoft.WinJS\js\WinJS.intellisense-setup.js">
<Link>Microsoft.WinJS.4.0\js\WinJS.intellisense-setup.js</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\Microsoft.WinJS\js\WinJS.intellisense.js">
<Link>Microsoft.WinJS.4.0\js\WinJS.intellisense.js</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\Microsoft.WinJS\fonts\Symbols.ttf">
<Link>Microsoft.WinJS.4.0\fonts\Symbols.ttf</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\Microsoft.WinJS\js\base.js">
<Link>Microsoft.WinJS.4.0\js\base.js</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\Microsoft.WinJS\js\ui.js">
<Link>Microsoft.WinJS.4.0\js\ui.js</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\sample-utils\footer.html">
<Link>sample-utils\footer.html</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\sample-utils\header.html">
<Link>sample-utils\header.html</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\sample-utils\sample-utils.js">
<Link>sample-utils\sample-utils.js</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\sample-utils\scenario-select.css">
<Link>sample-utils\scenario-select.css</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\js\sample-utils\scenario-select.html">
<Link>sample-utils\scenario-select.html</Link>
</Content>
<Content Include="css\scenario1-pinningsecondarytiles.css" />
<Content Include="css\scenario9-unpineverything.css" />
<Content Include="html\scenario1-pinningsecondarytiles.html" />
<Content Include="html\scenario2-updatesecondarytile.html" />
<Content Include="html\scenario3-primarytilenotifications.html" />
<Content Include="html\scenario4-secondarytilenotifications.html" />
<Content Include="html\scenario5-expiringtilenotifications.html" />
<Content Include="html\scenario6-schedulingtilenotifications.html" />
<Content Include="html\scenario7-primarytilebadges.html" />
<Content Include="html\scenario8-secondarytilebadges.html" />
<Content Include="html\scenario9-unpineverything.html" />
<Content Include="js\sample-configuration.js" />
<Content Include="js\scenario1-pinningsecondarytiles.js" />
<Content Include="js\scenario2-updatesecondarytile.js" />
<Content Include="js\scenario3-primarytilenotifications.js" />
<Content Include="js\scenario4-secondarytilenotifications.js" />
<Content Include="js\scenario5-expiringtilenotifications.js" />
<Content Include="js\scenario6-schedulingtilenotifications.js" />
<Content Include="js\scenario7-primarytilebadges.js" />
<Content Include="js\scenario8-secondarytilebadges.js" />
<Content Include="js\scenario9-unpineverything.js" />
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<!--image assets-->
<Content Include="..\..\..\..\SharedContent\media\microsoft-sdk.png">
<Link>images\microsoft-sdk.png</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\media\squaretile-sdk.png">
<Link>images\Square150x150Logo.png</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\media\smalltile-sdk.png">
<Link>images\Square44x44Logo.png</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\media\tile-sdk.png">
<Link>images\Wide310x150Logo.png</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\media\Square310x310Logo.png">
<Link>images\Square310x310Logo.png</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\media\splash-sdk.png">
<Link>images\SplashScreen.png</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\media\storelogo-sdk.png">
<Link>images\StoreLogo.png</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\media\windows-sdk.png">
<Link>images\windows-sdk.png</Link>
</Content>
<Content Include="images\cancel.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="images\check.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Reference Include="NotificationsExtensions">
<HintPath>..\packages\NotificationsExtensions.Win10.JavaScript.14332.0.2\lib\Windows\NotificationsExtensions.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<CopyLocal>True</CopyLocal>
<SpecificVersion>True</SpecificVersion>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
<Import Project="..\packages\NotificationsExtensions.Win10.JavaScript.14332.0.2\build\Windows\NotificationsExtensions.Win10.JavaScript.targets" Condition="Exists('..\packages\NotificationsExtensions.Win10.JavaScript.14332.0.2\build\Windows\NotificationsExtensions.Win10.JavaScript.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NotificationsExtensions.Win10.JavaScript.14332.0.2\build\Windows\NotificationsExtensions.Win10.JavaScript.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NotificationsExtensions.Win10.JavaScript.14332.0.2\build\Windows\NotificationsExtensions.Win10.JavaScript.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below then uncomment
that target and the DisableFastUpToDateCheck PropertyGroup.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<PropertyGroup>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
-->
</Project>
Loading

0 comments on commit ef073ed

Please sign in to comment.