Skip to content

Commit 2844ffb

Browse files
authored
Add samples to perform nano device operations (#153)
1 parent 9d9853f commit 2844ffb

File tree

16 files changed

+696
-3
lines changed

16 files changed

+696
-3
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{8AB7782B-4DB8-40A4-A846-86DE40AA3913}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>GetDeviceDetails</RootNamespace>
10+
<AssemblyName>GetDeviceDetails</AssemblyName>
11+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
<NuGetPackageImportStamp>
16+
</NuGetPackageImportStamp>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="System" />
39+
<Reference Include="System.ComponentModel.Composition" />
40+
<Reference Include="System.ComponentModel.DataAnnotations" />
41+
<Reference Include="System.Core" />
42+
<Reference Include="System.Xml.Linq" />
43+
<Reference Include="System.Data.DataSetExtensions" />
44+
<Reference Include="Microsoft.CSharp" />
45+
<Reference Include="System.Data" />
46+
<Reference Include="System.Xml" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<Compile Include="Program.cs" />
50+
<Compile Include="Properties\AssemblyInfo.cs" />
51+
</ItemGroup>
52+
<ItemGroup>
53+
<None Include="App.config" />
54+
</ItemGroup>
55+
<ItemGroup>
56+
<PackageReference Include="nanoFramework.Tools.FirmwareFlasher">
57+
<Version>2.2.1</Version>
58+
</PackageReference>
59+
</ItemGroup>
60+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
61+
</Project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
////
2+
// Copyright (c) .NET Foundation and Contributors
3+
// See LICENSE file in the project root for full license information.
4+
////
5+
6+
using nanoFramework.Tools.FirmwareFlasher;
7+
using System;
8+
9+
namespace GetDeviceDetails
10+
{
11+
internal class Program
12+
{
13+
// COM port where the nano device is connected
14+
// replace with the appropriate COM port number for the device you have connected
15+
private const string ComPort = "COM10";
16+
private static NanoDeviceOperations _nanoDeviceOperations;
17+
18+
static void Main(string[] args)
19+
{
20+
_nanoDeviceOperations = new NanoDeviceOperations();
21+
22+
var device = _nanoDeviceOperations.GetDeviceDetails(ComPort);
23+
24+
Console.Read();
25+
}
26+
}
27+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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("GetDeviceDetails")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("GetDeviceDetails")]
13+
[assembly: AssemblyCopyright("Copyright © 2022")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("8ab7782b-4db8-40a4-a846-86de40aa3913")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

Samples/ListJLinkDevicesApp/ListJLinkDevicesApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</ItemGroup>
5555
<ItemGroup>
5656
<PackageReference Include="nanoFramework.Tools.FirmwareFlasher">
57-
<Version>2.1.15</Version>
57+
<Version>2.2.1</Version>
5858
</PackageReference>
5959
</ItemGroup>
6060
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Samples/ListStmJtagDevicesApp/ListStmJtagDevicesApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</ItemGroup>
5353
<ItemGroup>
5454
<PackageReference Include="nanoFramework.Tools.FirmwareFlasher">
55-
<Version>2.1.15</Version>
55+
<Version>2.2.1</Version>
5656
</PackageReference>
5757
<PackageReference Include="Newtonsoft.Json">
5858
<Version>13.0.1</Version>
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
<!DOCTYPE html>
2+
<!-- saved from url=(0014)about:internet -->
3+
4+
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt"><head><meta content="en-us" http-equiv="Content-Language" /><meta content="text/html; charset=utf-16" http-equiv="Content-Type" /><title _locID="NuGetUpgradeReportTitle">
5+
NuGetMigrationLog
6+
</title><style>
7+
8+
/* Body style, for the entire document */
9+
body
10+
{
11+
background: #F3F3F4;
12+
color: #1E1E1F;
13+
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
14+
font-size: 12pt;
15+
padding: 0;
16+
margin: 0;
17+
}
18+
19+
/* Header1 style, used for the main title */
20+
h1
21+
{
22+
padding: 10px 0px 10px 10px;
23+
font-size: 21pt;
24+
background-color: #E2E2E2;
25+
border-bottom: 1px #C1C1C2 solid;
26+
color: #201F20;
27+
margin: 0;
28+
font-weight: normal;
29+
}
30+
31+
/* Header2 style, used for "Overview" and other sections */
32+
h2
33+
{
34+
font-size: 18pt;
35+
font-weight: normal;
36+
padding: 15px 0 5px 0;
37+
margin: 0;
38+
}
39+
40+
/* Header3 style, used for sub-sections, such as project name */
41+
h3
42+
{
43+
font-weight: normal;
44+
font-size: 15pt;
45+
margin: 0;
46+
padding: 15px 0 5px 0;
47+
background-color: transparent;
48+
}
49+
50+
.info-text
51+
{
52+
margin: 0px 0 0.75em 0;
53+
}
54+
55+
/* Color all hyperlinks one color */
56+
a
57+
{
58+
color: #1382CE;
59+
}
60+
61+
/* Table styles */
62+
table
63+
{
64+
border-spacing: 0 0;
65+
border-collapse: collapse;
66+
font-size: 11pt;
67+
}
68+
69+
table th
70+
{
71+
background: #E7E7E8;
72+
text-align: left;
73+
text-decoration: none;
74+
font-weight: normal;
75+
padding: 3px 6px 3px 6px;
76+
}
77+
78+
table td
79+
{
80+
vertical-align: top;
81+
padding: 3px 6px 5px 5px;
82+
margin: 0px;
83+
border: 1px solid #E7E7E8;
84+
background: #F7F7F8;
85+
}
86+
87+
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
88+
.localLink
89+
{
90+
color: #1E1E1F;
91+
background: #EEEEED;
92+
text-decoration: none;
93+
}
94+
95+
.localLink:hover
96+
{
97+
color: #1382CE;
98+
background: #FFFF99;
99+
text-decoration: none;
100+
}
101+
102+
.issueCell
103+
{
104+
width: 100%;
105+
}
106+
107+
.packageIssue
108+
{
109+
margin-left: 25px;
110+
}
111+
112+
/* Padding around the content after the h1 */
113+
#content
114+
{
115+
padding: 0px 20px 20px 20px;
116+
}
117+
118+
.issues table
119+
{
120+
width: 97%;
121+
}
122+
123+
/* All Icons */
124+
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded
125+
{
126+
min-width:18px;
127+
min-height:18px;
128+
background-repeat:no-repeat;
129+
background-position:center;
130+
}
131+
132+
.IconSuccessEncoded
133+
{
134+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABcElEQVR4Xq2TsUsCURzHv15g8ZJcBWlyiYYgCIWcb9DFRRwMW5TA2c0/QEFwFkxxUQdxVlBwCYWOi6IhWgQhBLHJUCkhLr/BW8S7gvrAg+N+v8/v+x68Z8MGy+XSCyABQAXgBgHGALoASkIIDWSLeLBetdHryMjd5IxQPWT4rn1c/P7+xxp72Cs9m5SZ0Bq2vPnbPFafK2zDvmNHypdC0BPkLlQhxJsCAhQoZwdZU5mwxh720qGo8MzTxTTKZDPCx2HoVzp6lz0Q9tKhyx0kGs8Ny+TkWRKk8lCROwEduhyg9l/6lunOPSfmH3NUH6uQ0KHLAe7JYvJjevm+DAMGJHToKtigE+vwvIidxLamb8IBY9e+C5LiXREkfho3TSd06HJA13/oh6T51MTsfQbHrsMynQ5dDihFjiK8JJAU9AKIWTp76dCVN7HWHrajmUEGvyF9nkbAE6gLIS7kTUyuf2gscLoJrElZo/Mvj+nPz/kLTmfnEwP3tB0AAAAASUVORK5CYII=);
135+
}
136+
137+
.IconInfoEncoded
138+
{
139+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
140+
}
141+
142+
.IconWarningEncoded
143+
{
144+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
145+
}
146+
147+
.IconErrorEncoded
148+
{
149+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
150+
}
151+
152+
</style></head><body><h1>
153+
NuGet Migration Report - UpdateNanoDeviceClr</h1><div id="content"><h2 _locID="OverviewTitle">Overview</h2><div class="info-text">Migration to PackageReference was completed successfully. Please build and run your solution to verify that all packages are available.</div><div class="info-text">
154+
If you run into any problems, have feedback, questions, or concerns, please
155+
<a href="https://github.com/NuGet/Home/issues/">file an issue on the NuGet GitHub repository.</a></div><div class="info-text">
156+
Changed files and this report have been backed up here:
157+
<a href="E:\GitHub\nf-nanoFirmwareFlasher\Samples\MigrationBackup\bd257cdf\UpdateNanoDeviceClr">E:\GitHub\nf-nanoFirmwareFlasher\Samples\MigrationBackup\bd257cdf\UpdateNanoDeviceClr</a></div><div class="info-text"><a href="https://aka.ms/nuget-pc2pr-migrator-rollback">Help me rollback to packages.config</a></div><h2 _locID="PackagesTitle">Packages processed</h2><h3 _locID="IncludePackagesTitle">Top-level dependencies:</h3><div class="issues"><table><tr><th class="issueCell">Package Id</th><th>Version</th></tr><tr><td class="issueCell"><span>nanoFramework.Tools.FirmwareFlasher</span></td><td><span>
158+
v2.2.1</span></td></tr></table></div><p /><h3 _locID="IncludePackagesTitle">Transitive dependencies:</h3><div class="issues"><table><tr><th class="issueCell">Package Id</th><th>Version</th></tr><tr><td class="issueCell"><span>Fody</span></td><td><span>
159+
v4.2.1</span></td></tr><tr><td class="issueCell"><span>Microsoft.Bcl.AsyncInterfaces</span></td><td><span>
160+
v6.0.0</span></td></tr><tr><td class="issueCell"><span>Microsoft.Extensions.DependencyInjection.Abstractions</span></td><td><span>
161+
v6.0.0</span></td></tr><tr><td class="issueCell"><span>Microsoft.Extensions.Options</span></td><td><span>
162+
v6.0.0</span></td></tr><tr><td class="issueCell"><span>Microsoft.Extensions.Options.DataAnnotations</span></td><td><span>
163+
v6.0.0</span></td></tr><tr><td class="issueCell"><span>Microsoft.Extensions.Primitives</span></td><td><span>
164+
v6.0.0</span></td></tr><tr><td class="issueCell"><span>nanoFramework.Tools.Debugger.Net</span></td><td><span>
165+
v2.4.1</span></td></tr><tr><td class="issueCell"><span>Newtonsoft.Json</span></td><td><span>
166+
v13.0.1</span></td></tr><tr><td class="issueCell"><span>Polly</span></td><td><span>
167+
v7.2.3</span></td></tr><tr><td class="issueCell"><span>PropertyChanged.Fody</span></td><td><span>
168+
v2.6.1</span></td></tr><tr><td class="issueCell"><span>System.Buffers</span></td><td><span>
169+
v4.5.1</span></td></tr><tr><td class="issueCell"><span>System.ComponentModel.Annotations</span></td><td><span>
170+
v5.0.0</span></td></tr><tr><td class="issueCell"><span>System.IO</span></td><td><span>
171+
v4.3.0</span></td></tr><tr><td class="issueCell"><span>System.IO.Ports</span></td><td><span>
172+
v6.0.0</span></td></tr><tr><td class="issueCell"><span>System.Memory</span></td><td><span>
173+
v4.5.4</span></td></tr><tr><td class="issueCell"><span>System.Net.Http</span></td><td><span>
174+
v4.3.4</span></td></tr><tr><td class="issueCell"><span>System.Numerics.Vectors</span></td><td><span>
175+
v4.5.0</span></td></tr><tr><td class="issueCell"><span>System.Runtime</span></td><td><span>
176+
v4.3.0</span></td></tr><tr><td class="issueCell"><span>System.Runtime.CompilerServices.Unsafe</span></td><td><span>
177+
v6.0.0</span></td></tr><tr><td class="issueCell"><span>System.Security.Cryptography.Algorithms</span></td><td><span>
178+
v4.3.0</span></td></tr><tr><td class="issueCell"><span>System.Security.Cryptography.Encoding</span></td><td><span>
179+
v4.3.0</span></td></tr><tr><td class="issueCell"><span>System.Security.Cryptography.Primitives</span></td><td><span>
180+
v4.3.0</span></td></tr><tr><td class="issueCell"><span>System.Security.Cryptography.X509Certificates</span></td><td><span>
181+
v4.3.0</span></td></tr><tr><td class="issueCell"><span>System.Threading.Tasks.Extensions</span></td><td><span>
182+
v4.5.4</span></td></tr></table></div><h2 _locID="IssuesTitle">Package compatibility issues</h2><div class="issues"><table><tr><th /><th class="issueCell" _locID="DescriptionTableHeader">Description</th></tr><tr><td class="IconInfoEncoded" /><td class="issueCell">
183+
No issues were found.
184+
</td></tr></table></div></div></body></html>

0 commit comments

Comments
 (0)