Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollo3zehn committed Feb 20, 2024
1 parent 8be0a03 commit 6863bb8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/FluentModbus/Client/ModbusTcpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,18 @@ protected override Span<byte> TransceiveFrame(byte unitIdentifier, ModbusFunctio

if (BitConverter.IsLittleEndian)
{
writer.WriteReverse(GetTransactionIdentifier()); // 00-01 Transaction Identifier
writer.WriteReverse((ushort)0); // 02-03 Protocol Identifier
writer.WriteReverse((ushort)(frameLength - 6)); // 04-05 Length
writer.WriteReverse(GetTransactionIdentifier()); // 00-01 Transaction Identifier
writer.WriteReverse((ushort)0); // 02-03 Protocol Identifier
writer.WriteReverse((ushort)(frameLength - 6)); // 04-05 Length
}
else
{
writer.Write(GetTransactionIdentifier()); // 00-01 Transaction Identifier
writer.Write((ushort)0); // 02-03 Protocol Identifier
writer.Write((ushort)(frameLength - 6)); // 04-05 Length
writer.Write(GetTransactionIdentifier()); // 00-01 Transaction Identifier
writer.Write((ushort)0); // 02-03 Protocol Identifier
writer.Write((ushort)(frameLength - 6)); // 04-05 Length
}

writer.Write(unitIdentifier); // 06 Unit Identifier
writer.Write(unitIdentifier); // 06 Unit Identifier

// send request
_networkStream.Write(frameBuffer.Buffer, 0, frameLength);
Expand Down

0 comments on commit 6863bb8

Please sign in to comment.