未验证 提交 0d488ba2 编写于 作者: K Krzysztof Wicher 提交者: GitHub

simplify and fix serialport-arduino sample (#75)

* simplify and fix serialport-arduino sample

* add sdk version in global.json
上级 4e999ddc
......@@ -46,21 +46,10 @@ To setup such app from the scratch (assumes your folder name is `arduino-demo` a
```
dotnet new console
dotnet add package System.IO.Ports
dotnet add package System.IO.Ports -v 4.6.0-preview.18571.3
```
ensure you got following nuget.config:
```xml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
</packageSources>
</configuration>
```
add runtime identifier in the property group to make it easier to publish:
add runtime identifier in the property group to make it easier to publish (you can also provide it during publishing: `dotnet publish -r linux-arm`):
```xml
<RuntimeIdentifier>linux-arm</RuntimeIdentifier>
......@@ -79,12 +68,6 @@ To run your app simply call it while in that directory
./arduino-demo /dev/ttyS0
```
Note: this version might be out of date and not contain recent fixes - please see dogfooding instructions to test latest version of System.IO.Ports
### To dogfood latest bits
[See example csproj file](arduino-demo.csproj) and edit versions accordingly (currently contains latest as of writing this demo). It contains comments explaining how to edit it and find latest versions.
## Arduino example app
The most interesting part of the code is `serial_on_line_read` and `SPIN_PIXEL_ONCE` macro.
......
......@@ -6,22 +6,9 @@
<RootNamespace>arduino_demo</RootNamespace>
<!-- this can also be passed from the command line (i.e. dotnet publish -r linux-arm) -->
<RuntimeIdentifier>linux-arm</RuntimeIdentifier>
<!--
To use the latest version of core-setup we can pass the version manually:
<RuntimeFrameworkVersion>4.6.0-preview.18559.1</RuntimeFrameworkVersion>
Latest versions of all packages used here can be found here
(RuntimeFrameworkVersion is related to Microsoft.NETCore.App package):
https://github.com/dotnet/versions/blob/master/build-info/dotnet/core-setup/master/Latest_Packages.txt
Currently this is not needed because we consume private corefx.
Once this gets public the following line and package reference to Microsoft.Private.CoreFx.NETCoreApp
can be removed.
-->
<PackageConflictPreferredPackages>Microsoft.Private.CoreFx.NETCoreApp;runtime.$(RuntimeIdentifier).Microsoft.Private.CoreFx.NETCoreApp;$(PackageConflictPreferredPackages)</PackageConflictPreferredPackages>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Private.CoreFx.NETCoreApp" Version="4.6.0-preview.18559.1" />
<PackageReference Include="System.IO.Ports" Version="4.6.0-preview.18558.3" />
</ItemGroup>
......
{
"sdk": {
"version": "3.0.100-*"
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册