From 44caa91fbf3e92186d6a1376f34fa604e225685d Mon Sep 17 00:00:00 2001 From: mag Date: Tue, 11 Jun 2024 15:03:14 +0500 Subject: [PATCH] Rewrite to work with dotnet 8 --- NModbus.IntegrationTests/NModbus.IntegrationTests.csproj | 2 +- NModbus.SerialPortStream/SerialPortStreamAdapter.cs | 8 ++++++++ NModbus.UnitTests/NModbus.UnitTests.csproj | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NModbus.IntegrationTests/NModbus.IntegrationTests.csproj b/NModbus.IntegrationTests/NModbus.IntegrationTests.csproj index e0a3b91..4875e5e 100644 --- a/NModbus.IntegrationTests/NModbus.IntegrationTests.csproj +++ b/NModbus.IntegrationTests/NModbus.IntegrationTests.csproj @@ -1,8 +1,8 @@  - net46;net6.0 false + net8.0 diff --git a/NModbus.SerialPortStream/SerialPortStreamAdapter.cs b/NModbus.SerialPortStream/SerialPortStreamAdapter.cs index 81040e8..4a5b9de 100644 --- a/NModbus.SerialPortStream/SerialPortStreamAdapter.cs +++ b/NModbus.SerialPortStream/SerialPortStreamAdapter.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using NModbus.IO; namespace NModbus.SerialPortStream @@ -43,6 +44,13 @@ public int Read(byte[] buffer, int offset, int count) return result; } + public Task ReadAsync(byte[] buffer, int offset, int count) + { + var result = _serialPortStream.ReadAsync(buffer, offset, count); + + return result; + } + public void Write(byte[] buffer, int offset, int count) { _serialPortStream.Write(buffer, offset, count); diff --git a/NModbus.UnitTests/NModbus.UnitTests.csproj b/NModbus.UnitTests/NModbus.UnitTests.csproj index 6159dff..e4981f2 100644 --- a/NModbus.UnitTests/NModbus.UnitTests.csproj +++ b/NModbus.UnitTests/NModbus.UnitTests.csproj @@ -1,7 +1,7 @@ - net4.6 + net8.0 true NModbus.UnitTests NModbus.UnitTests