Skip to content

Commit

Permalink
Merge pull request #1273 from pkuehnel/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
pkuehnel authored May 29, 2024
2 parents ec91d90 + e6d9260 commit 18a3864
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public async Task Connect(IPEndPoint ipEndPoint, ModbusEndianess endianess, Time
};
ConnectTimeout = (int)connectTimeout.TotalMilliseconds;
logger.LogTrace("ConnectTimeout: {ConnectTimeout}", ConnectTimeout);
base.Connect(ipEndPoint, fluentEndianness);
base.Connect(ipEndPoint, ModbusEndianness.BigEndian);
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Net;
using TeslaSolarCharger.Services.Services.Modbus.Contracts;
using TeslaSolarCharger.Shared.Enums;
using static System.Runtime.InteropServices.JavaScript.JSType;

namespace TeslaSolarCharger.Services.Services.Modbus;

Expand Down Expand Up @@ -46,7 +45,7 @@ public void RemoveClient(string host, int port)

private static byte[] ConvertToCorrectEndianess(ModbusEndianess endianess, byte[] byteArray)
{
var tempArray = endianess == ModbusEndianess.LittleEndian ? byteArray : byteArray.Reverse().ToArray();
var tempArray = byteArray.Reverse().ToArray();
if (endianess == ModbusEndianess.LittleEndian && tempArray.Length % 4 == 0)
{
var swappedByteArray = new byte[tempArray.Length];
Expand Down

0 comments on commit 18a3864

Please sign in to comment.