Skip to content

Commit

Permalink
Rewrite to work with dotnet 8
Browse files Browse the repository at this point in the history
  • Loading branch information
mag committed Jun 11, 2024
1 parent 4021adc commit 44caa91
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion NModbus.IntegrationTests/NModbus.IntegrationTests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net46;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions NModbus.SerialPortStream/SerialPortStreamAdapter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;
using NModbus.IO;

namespace NModbus.SerialPortStream
Expand Down Expand Up @@ -43,6 +44,13 @@ public int Read(byte[] buffer, int offset, int count)
return result;
}

public Task<int> 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);
Expand Down
2 changes: 1 addition & 1 deletion NModbus.UnitTests/NModbus.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net4.6</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblyName>NModbus.UnitTests</AssemblyName>
<PackageId>NModbus.UnitTests</PackageId>
Expand Down

0 comments on commit 44caa91

Please sign in to comment.