Skip to content

Commit

Permalink
Windows 10 Version 1709 - March 2018 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnewthing committed Mar 8, 2018
1 parent f08e1a9 commit f6ad9bc
Show file tree
Hide file tree
Showing 27 changed files with 895 additions and 63 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,24 +328,25 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
<tr>
<td><a href="Samples/LampDevice">Lamp device</a></td>
<td><a href="Samples/LightSensor">Light sensor</a></td>
<td><a href="Samples/MagneticStripeReader">Magnetic stripe reader</a></td>
<td><a href="Samples/Magnetometer">Magnetometer</a></td>
</tr>
<tr>
<td><a href="Samples/MagneticStripeReader">Magnetic stripe reader</a></td>
<td><a href="Samples/Nfc">Near field communication (NFC)</a></td>
<td><a href="Samples/NfcProvisioner">NFC enterprise provisioner</a></td>
<td><a href="Samples/OrientationSensor">Orientation sensor</a></td>
</tr>
<tr>
<td><a href="Samples/OrientationSensor">Orientation sensor</a></td>
<td><a href="Samples/Pedometer">Pedometer</a></td>
<td><a href="Samples/PosPrinter">POS printer</a></td>
<td><a href="Samples/ProximitySensor">Proximity sensor</a></td>
</tr>
<tr>
<td><a href="Samples/ProximitySensor">Proximity sensor</a></td>
<td><a href="Samples/RadialController">Radial controller</a></td>
<td><a href="Samples/RelativeInclinometer">Relative inclinometer</a></td>
<td><a href="Samples/SerialArduino">Serial Arduino</a></td>
</tr>
<tr>
<td><a href="Samples/SerialArduino">Serial Arduino</a></td>
<td><a href="Samples/IoT-SPI">Serial Peripheral Interface (SPI)</a></td>
<td><a href="Samples/SimpleOrientationSensor">Simple orientation sensor</a></td>
</tr>
Expand Down
4 changes: 1 addition & 3 deletions Samples/BarcodeScanner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ This sample shows how to:

The app package manifest shows how to specify the device capability name for the Point of Service (POS) devices. All POS apps are required declare [DeviceCapability](http://msdn.microsoft.com/library/windows/apps/br211430) in the app package manifest, either by using "PointofService" as shown in this sample or by using a device specific GUID, such as "C243FFBD-3AFC-45E9-B3D3-2BA18BC7EBC5" for a barcode scanner.

For a list of compatible barcode scanners, see [Supported Point of Service Peripherals](https://docs.microsoft.com/windows/uwp/devices-sensors/pos-device-support).

**Note** The Universal Windows app samples require Visual Studio 2017 to build and Windows 10 to execute.

To obtain information about Windows 10 development, go to the [Windows Dev Center](http://go.microsoft.com/fwlink/?LinkID=532421)
Expand All @@ -60,7 +58,7 @@ To obtain information about Microsoft Visual Studio and the tools for developing
### Reference

[Windows.Devices.PointOfService namespace](http://msdn.microsoft.com/library/windows/apps/dn298071)
[Barcode Scanner Compatible Hardware](https://docs.microsoft.com/windows/uwp/devices-sensors/barcode-scanner#compatible-hardware)
[Supported Point of Service Peripherals](https://docs.microsoft.com/windows/uwp/devices-sensors/pos-device-support)
[USB HID POS Scanner specification](http://go.microsoft.com/fwlink/p/?linkid=309230)
[Windows app samples](http://go.microsoft.com/fwlink/p/?LinkID=227694)

Expand Down
2 changes: 0 additions & 2 deletions Samples/CustomCapability/Service/Client/RpcClient.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,11 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
Expand Down
8 changes: 2 additions & 6 deletions Samples/CustomCapability/cpp/CustomCapability.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.12
VisualStudioVersion = 15.0.27130.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CustomCapability", "CustomCapability.vcxproj", "{F655DED8-41FA-5704-A228-20E83EAB795C}"
ProjectSection(ProjectDependencies) = postProject
Expand All @@ -16,7 +16,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RpcServer", "..\Service\Ser
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RpcClient", "..\Service\Client\RpcClient.vcxproj", "{86B5561E-46B3-5DDE-9121-423803DA2807}"
ProjectSection(ProjectDependencies) = postProject
ProjectSection(ProjectDependencies) = postProject
{E70C6CFC-C72D-54DE-9729-B3594113D55C} = {E70C6CFC-C72D-54DE-9729-B3594113D55C}
EndProjectSection
EndProject
Expand Down Expand Up @@ -49,14 +49,12 @@ Global
{F655DED8-41FA-5704-A228-20E83EAB795C}.Release|x86.Build.0 = Release|Win32
{F655DED8-41FA-5704-A228-20E83EAB795C}.Release|x86.Deploy.0 = Release|Win32
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|ARM.ActiveCfg = Debug|ARM
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|ARM.Build.0 = Debug|ARM
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|x64.ActiveCfg = Debug|x64
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|x64.Build.0 = Debug|x64
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|x64.Deploy.0 = Debug|x64
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|x86.ActiveCfg = Debug|Win32
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|x86.Build.0 = Debug|Win32
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Release|ARM.ActiveCfg = Release|ARM
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Release|ARM.Build.0 = Release|ARM
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Release|x64.ActiveCfg = Release|x64
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Release|x64.Build.0 = Release|x64
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Release|x86.ActiveCfg = Release|Win32
Expand All @@ -72,13 +70,11 @@ Global
{D61475C4-185E-50F6-8FAD-A0163961B3B3}.Release|x86.ActiveCfg = Release|Win32
{D61475C4-185E-50F6-8FAD-A0163961B3B3}.Release|x86.Build.0 = Release|Win32
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|ARM.ActiveCfg = Debug|ARM
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|ARM.Build.0 = Debug|ARM
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|x64.ActiveCfg = Debug|x64
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|x64.Build.0 = Debug|x64
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|x86.ActiveCfg = Debug|Win32
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|x86.Build.0 = Debug|Win32
{86B5561E-46B3-5DDE-9121-423803DA2807}.Release|ARM.ActiveCfg = Release|ARM
{86B5561E-46B3-5DDE-9121-423803DA2807}.Release|ARM.Build.0 = Release|ARM
{86B5561E-46B3-5DDE-9121-423803DA2807}.Release|x64.ActiveCfg = Release|x64
{86B5561E-46B3-5DDE-9121-423803DA2807}.Release|x64.Build.0 = Release|x64
{86B5561E-46B3-5DDE-9121-423803DA2807}.Release|x86.ActiveCfg = Release|Win32
Expand Down
30 changes: 17 additions & 13 deletions Samples/CustomCapability/cpp/CustomCapability.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,28 @@
<IncludePath>$(IncludePath);..\..\..\SharedContent\cpp</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)</OutDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)</OutDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)</OutDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)</OutDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)</OutDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)</OutDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand All @@ -128,7 +132,7 @@
<ShowIncludes>false</ShowIncludes>
</ClCompile>
<Link>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib;$(OutDir)rpcclient.lib</AdditionalDependencies>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib;$(IntDir)rpcclient.lib</AdditionalDependencies>
<OptimizeReferences>false</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
Expand All @@ -140,7 +144,7 @@
<ShowIncludes>false</ShowIncludes>
</ClCompile>
<Link>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib;$(OutDir)rpcclient.lib</AdditionalDependencies>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib</AdditionalDependencies>
<OptimizeReferences>false</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
Expand All @@ -152,7 +156,7 @@
<ShowIncludes>false</ShowIncludes>
</ClCompile>
<Link>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib;$(OutDir)rpcclient.lib</AdditionalDependencies>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib;$(IntDir)rpcclient.lib</AdditionalDependencies>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
Expand All @@ -164,7 +168,7 @@
<ShowIncludes>false</ShowIncludes>
</ClCompile>
<Link>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib;$(OutDir)rpcclient.lib</AdditionalDependencies>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib</AdditionalDependencies>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
Expand All @@ -176,7 +180,7 @@
<ShowIncludes>false</ShowIncludes>
</ClCompile>
<Link>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib;$(OutDir)rpcclient.lib</AdditionalDependencies>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib;$(IntDir)rpcclient.lib</AdditionalDependencies>
<OptimizeReferences>false</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
Expand All @@ -188,7 +192,7 @@
<ShowIncludes>false</ShowIncludes>
</ClCompile>
<Link>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib;$(OutDir)rpcclient.lib</AdditionalDependencies>
<AdditionalDependencies>vccorlib.lib;WindowsApp.lib;%(AdditionalDependencies);rpcrt4.lib;$(IntDir)rpcclient.lib</AdditionalDependencies>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -307,7 +311,7 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Service\Client\RpcClient.vcxproj">
<ProjectReference Condition="'$(Platform)' == 'x86' Or '$(Platform)' == 'x64'" Include="..\Service\Client\RpcClient.vcxproj">
<Project>{86B5561E-46B3-5DDE-9121-423803DA2807}</Project>
<Name>RpcClient</Name>
</ProjectReference>
Expand Down
12 changes: 12 additions & 0 deletions Samples/CustomCapability/cpp/ServiceViewModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::ApplicationModel;

#if defined (_M_IX86) || defined(_M_AMD64)
#define SERVICE_SUPPORTED 1
#endif

ServiceViewModel::ServiceViewModel()
{
// Set default rate
Expand Down Expand Up @@ -184,6 +188,7 @@ void ServiceViewModel::StartMetering(int sampleRate)
StopButtonEnabled = true;
stopMeteringRequested = false;

#ifdef SERVICE_SUPPORTED
if (NotifyIfAnyError(RpcClientInitialize(&rpcclient))) return;

meteringOn = true;
Expand Down Expand Up @@ -272,6 +277,9 @@ void ServiceViewModel::StartMetering(int sampleRate)
}
RpcClientClose(this->rpcclient);
}
#else
NotifyStatusMessage("NT service support has not been compiled for this architecture.", NotifyType::ErrorMessage);
#endif
});
}

Expand All @@ -286,12 +294,14 @@ void ServiceViewModel::StopMetering()
SliderEnabled = false;
stopMeteringRequested = true;

#ifdef SERVICE_SUPPORTED
__int64 retCode = StopMeteringData(this->rpcclient);
if (!NotifyIfAnyError(retCode))
{
NotifyStatusMessage("Metering stop command sent successfully",
NotifyType::StatusMessage);
}
#endif

SliderEnabled = true;
StartButtonEnabled = true;
Expand All @@ -306,6 +316,7 @@ void ServiceViewModel::SetSamplePeriod(int samplePeriod)
create_task([this, samplePeriod]
{
this->samplePeriod = samplePeriod;
#ifdef SERVICE_SUPPORTED
if (meteringOn)
{
_int64 retCode = SetSampleRate(rpcclient, samplePeriod);
Expand All @@ -316,5 +327,6 @@ void ServiceViewModel::SetSamplePeriod(int samplePeriod)
NotifyType::StatusMessage);
}
}
#endif
});
}
2 changes: 1 addition & 1 deletion Samples/CustomCapability/cs/CustomCapability.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Service\Client\RpcClient.vcxproj">
<ProjectReference Condition="'$(Platform)' == 'x86' Or '$(Platform)' == 'x64'" Include="..\Service\Client\RpcClient.vcxproj">
<Project>{2c78f411-866b-472d-9c28-75d59f179525}</Project>
<Name>RpcClient</Name>
</ProjectReference>
Expand Down
8 changes: 2 additions & 6 deletions Samples/CustomCapability/cs/CustomCapability.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.12
VisualStudioVersion = 15.0.27130.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RpcInterface", "..\Service\Interface\RpcInterface.vcxproj", "{E70C6CFC-C72D-54DE-9729-B3594113D55C}"
EndProject
Expand All @@ -11,7 +11,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RpcServer", "..\Service\Ser
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RpcClient", "..\Service\Client\RpcClient.vcxproj", "{86B5561E-46B3-5DDE-9121-423803DA2807}"
ProjectSection(ProjectDependencies) = postProject
ProjectSection(ProjectDependencies) = postProject
{E70C6CFC-C72D-54DE-9729-B3594113D55C} = {E70C6CFC-C72D-54DE-9729-B3594113D55C}
EndProjectSection
EndProject
Expand All @@ -28,14 +28,12 @@ Global
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|ARM.ActiveCfg = Debug|ARM
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|ARM.Build.0 = Debug|ARM
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|x64.ActiveCfg = Debug|x64
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|x64.Build.0 = Debug|x64
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|x64.Deploy.0 = Debug|x64
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|x86.ActiveCfg = Debug|Win32
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Debug|x86.Build.0 = Debug|Win32
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Release|ARM.ActiveCfg = Release|ARM
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Release|ARM.Build.0 = Release|ARM
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Release|x64.ActiveCfg = Release|x64
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Release|x64.Build.0 = Release|x64
{E70C6CFC-C72D-54DE-9729-B3594113D55C}.Release|x86.ActiveCfg = Release|Win32
Expand All @@ -51,13 +49,11 @@ Global
{D61475C4-185E-50F6-8FAD-A0163961B3B3}.Release|x86.ActiveCfg = Release|Win32
{D61475C4-185E-50F6-8FAD-A0163961B3B3}.Release|x86.Build.0 = Release|Win32
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|ARM.ActiveCfg = Debug|ARM
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|ARM.Build.0 = Debug|ARM
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|x64.ActiveCfg = Debug|x64
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|x64.Build.0 = Debug|x64
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|x86.ActiveCfg = Debug|Win32
{86B5561E-46B3-5DDE-9121-423803DA2807}.Debug|x86.Build.0 = Debug|Win32
{86B5561E-46B3-5DDE-9121-423803DA2807}.Release|ARM.ActiveCfg = Release|ARM
{86B5561E-46B3-5DDE-9121-423803DA2807}.Release|ARM.Build.0 = Release|ARM
{86B5561E-46B3-5DDE-9121-423803DA2807}.Release|x64.ActiveCfg = Release|x64
{86B5561E-46B3-5DDE-9121-423803DA2807}.Release|x64.Build.0 = Release|x64
{86B5561E-46B3-5DDE-9121-423803DA2807}.Release|x86.ActiveCfg = Release|Win32
Expand Down
21 changes: 17 additions & 4 deletions Samples/CustomCapability/cs/ServiceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public class ServiceViewModel : INotifyPropertyChanged
[DllImport("api-ms-win-core-sysinfo-l1-2-1.dll")]
static extern void GetSystemTimeAsFileTime(ref FILETIME lpSystemTimeAsFileTime);

[DllImport("api-ms-win-core-libraryloader-l2-1.dll")]
static extern IntPtr LoadPackagedLibrary(string filename, uint reserved);

public static ServiceViewModel Current { get; private set; }

static ServiceViewModel()
Expand Down Expand Up @@ -84,6 +87,7 @@ private async void SuspendMeteringService(object sender, SuspendingEventArgs e)
deferral.Complete();
}

Lazy<bool> isSupported = new Lazy<bool>(() => LoadPackagedLibrary("RpcClient.dll", 0) != IntPtr.Zero);
volatile bool meteringOn;
volatile bool meteringOnWhileSuspension;
Windows.UI.Core.CoreDispatcher dispatcher;
Expand Down Expand Up @@ -205,6 +209,12 @@ await Task.Run(() =>
StopButtonEnabled = true;
stopMeteringRequested = false;

if (!isSupported.Value)
{
NotifyStatusMessage("NT service support has not been compiled for this architecture.", NotifyType.ErrorMessage);
return;
}

if (NotifyIfAnyError(RpcClientInitialize(out rpcClient))) return;

meteringOn = true;
Expand Down Expand Up @@ -328,11 +338,14 @@ await Task.Run(() =>
SliderEnabled = false;
stopMeteringRequested = true;

long retCode = StopMeteringData(rpcClient);
if (!NotifyIfAnyError(retCode))
if (isSupported.Value)
{
NotifyStatusMessage("Metering stop command sent successfully",
NotifyType.StatusMessage);
long retCode = StopMeteringData(rpcClient);
if (!NotifyIfAnyError(retCode))
{
NotifyStatusMessage("Metering stop command sent successfully",
NotifyType.StatusMessage);
}
}

SliderEnabled = true;
Expand Down
2 changes: 1 addition & 1 deletion Samples/CustomCapability/js/CustomCapability.jsproj
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<Content Include="js\scenario5_deviceReadWrite.js" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="RpcClientRt\RpcClientRt.vcxproj" />
<ProjectReference Condition="'$(Platform)' == 'x86' Or '$(Platform)' == 'x64'" Include="RpcClientRt\RpcClientRt.vcxproj" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
<!-- To modify your build process, add your task inside one of the targets below then uncomment
Expand Down
Loading

0 comments on commit f6ad9bc

Please sign in to comment.