Skip to content

Commit

Permalink
MQTT.NET Updated and fixed High Register Decoding bug
Browse files Browse the repository at this point in the history
  • Loading branch information
timgebauer authored and timgebauer committed Jul 10, 2023
1 parent f8f0053 commit 57d580a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion RaspTracer-AN-Modbus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.IO.Ports" Version="7.0.0" />
<PackageReference Include="MQTTnet" Version="4.2.0.706" />
<PackageReference Include="MQTTnet" Version="4.2.1.781" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Services/EPEverStatusUpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ private string RetrieveParameter(EPEverQuery param)

if (param.HasHighRegister)
{
byte[] byteArrayHigh = param.ByteArray;
byteArrayHigh[2] = (byte)(byteArrayHigh[2] + 1);
byte[] byteArrayHigh = param.ByteArray.ToArray();
byteArrayHigh[2]++;
var queryPackageHigh = new EPEverQueryPackage(byteArrayHigh);
byte[] responseHigh = this.iOConnector.GetValueFromEPever(queryPackageHigh);
responseBytes = new byte[] { responseHigh[3], responseHigh[4], response[3], response[4] };
Expand Down

0 comments on commit 57d580a

Please sign in to comment.