retarget .net framework 2.0 for unity
This commit is contained in:
Родитель
a84932b5a5
Коммит
93fc13f873
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace Jacdac.Servers
|
|||
public void Play(string name)
|
||||
{
|
||||
if (name == null)
|
||||
throw new ArgumentNullException(nameof(name));
|
||||
throw new ArgumentNullException("name");
|
||||
|
||||
var fileName = Path.GetFileNameWithoutExtension(name); // filter out rooted paths
|
||||
var mp3 = Path.Combine(this.soundDirectory, fileName + ".mp3");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace Jacdac.Transports.WebSockets
|
|||
try
|
||||
{
|
||||
if (!t.IsFaulted && this.socket != null)
|
||||
this.socket.SendAsync(data, WebSocketMessageType.Binary, true, CancellationToken.None);
|
||||
this.socket.SendAsync(new ArraySegment<byte>(data), WebSocketMessageType.Binary, true, CancellationToken.None);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ namespace Jacdac.Transports.WebSockets
|
|||
&& this.socket != null)
|
||||
{
|
||||
var buffer = new byte[0xff];
|
||||
var res = await this.socket.ReceiveAsync(buffer, CancellationToken.None);
|
||||
var res = await this.socket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None);
|
||||
if (res.Count > 0)
|
||||
{
|
||||
var frame = new byte[res.Count];
|
||||
|
@ -139,7 +139,7 @@ namespace Jacdac.Transports.WebSockets
|
|||
this.socket = null;
|
||||
if (socket.State != WebSocketState.Closed)
|
||||
socket.CloseAsync(WebSocketCloseStatus.NormalClosure, null, CancellationToken.None)
|
||||
.ContinueWith(t => socket.Dispose());
|
||||
.ContinueWith(_ => socket.Dispose());
|
||||
else socket.Dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace Jacdac.Servers
|
|||
var lines = File.Exists(this.fileName) ? File.ReadAllLines(this.fileName) : new string[0];
|
||||
foreach (var line in lines)
|
||||
{
|
||||
var kv = line.Split(":");
|
||||
var kv = line.Split(':');
|
||||
if (kv.Length != 2) continue;
|
||||
var key = kv[0].Trim();
|
||||
if (key.Length == 0) continue;
|
||||
|
@ -53,13 +53,15 @@ namespace Jacdac.Servers
|
|||
var dir = Path.GetDirectoryName(Path.GetFullPath(this.fileName));
|
||||
if (!Directory.Exists(dir))
|
||||
Directory.CreateDirectory(dir);
|
||||
using var writer = new StreamWriter(this.fileName);
|
||||
foreach (var key in dic.Keys)
|
||||
using (var writer = new StreamWriter(this.fileName))
|
||||
{
|
||||
writer.Write(key.Replace(Environment.NewLine, " "));
|
||||
writer.Write(": ");
|
||||
writer.Write(HexEncoding.ToString(dic[key]));
|
||||
writer.WriteLine();
|
||||
foreach (var key in dic.Keys)
|
||||
{
|
||||
writer.Write(key.Replace(Environment.NewLine, " "));
|
||||
writer.Write(": ");
|
||||
writer.Write(HexEncoding.ToString(dic[key]));
|
||||
writer.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
|
|
12
README.md
12
README.md
|
@ -4,7 +4,7 @@
|
|||
for **microcontrollers** and their peripherals (sensors/actuators),
|
||||
with applications to rapid prototyping, making, and physical computing.
|
||||
|
||||
This repository contains **.NET Core (5+)**, **.NET nanoframework** and **TinyCLR** client libraries for the [Jacdac](https://aka.ms/jacdac) protocol,
|
||||
This repository contains **.NET Framework 2.0**, **.NET nanoframework** and **TinyCLR** client libraries for the [Jacdac](https://aka.ms/jacdac) protocol,
|
||||
as well as transports over USB, SPI, WebSockets.
|
||||
|
||||
* **[Jacdac .NET Documentation](https://microsoft.github.io/jacdac-docs/clients/dotnet)**
|
||||
|
@ -17,18 +17,18 @@ as well as transports over USB, SPI, WebSockets.
|
|||
|
||||
The Jacdac project contains C# sources of the Jacdac protocol for various .NET runtime, including desktop or TinyClR.
|
||||
To avoid mscorlib issues, each platform recompiles these sources into its own assembly where C# files are simply shared as links.
|
||||
As a result, the C# used in the Jacdac project is .NET 5+/.NET nanoframework/TinyCLR compatible (and also inherits limitations thereof).
|
||||
As a result, the C# used in the Jacdac project is .NET Framework 2.0/.NET nanoframework/TinyCLR compatible (and also inherits limitations thereof).
|
||||
|
||||
### [.NET Core](https://docs.microsoft.com/en-us/dotnet/core/introduction) and [.NET IoT Core](https://dotnet.microsoft.com/en-us/apps/iot)
|
||||
### [.NET Framework 2.0](https://dotnet.microsoft.com/en-us/) and [.NET IoT Core](https://dotnet.microsoft.com/en-us/apps/iot)
|
||||
|
||||
- `Jacdac.NET`, core runtime
|
||||
- `Jacdac.NET.Clients`, service clients
|
||||
- `Jacdac.NET.Logging`, a logging provider that allows to send log messages over the Jacdac bus
|
||||
- `Jacdac.NET.Transports.Spi`, SPI transport layer for SPI Jacdapter using .NET IoT
|
||||
- `Jacdac.NET.Transports.WebSockets`, WebSocket transport
|
||||
- `Jacdac.NET.Transports.Hf2`, HF2 protocol layer, .NET5
|
||||
- `Jacdac.NET.Transports.LibUsb`, Usb transport based on [libusb](https://libusb.info/), .NET5 **(not functional, experimental)**
|
||||
- `Jacdac.NET.Servers.SoundPlayer`, .NET sound player server implementation
|
||||
- `Jacdac.NET.Transports.Hf2`, HF2 protocol layer, .NET Framework 2.0
|
||||
- `Jacdac.NET.Transports.LibUsb`, Usb transport based on [libusb](https://libusb.info/), .NET Framework 2.0
|
||||
- `Jacdac.NET.Servers.SoundPlayer`, .NET Framework 2.0 sound player server implementation
|
||||
|
||||
### [TinyCLR](https://www.ghielectronics.com/tinyclr/)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче