Skip to content

Commit

Permalink
fix issue with command length handling
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-tf committed Jul 28, 2022
1 parent d3b808b commit 1252c58
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions FXCommands/ConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ public void SendMessage(string message, bool canRetry = true)
int port = 29200; // fx console

byte[] b_header = "43:4d:4e:44".Split(':').Select(s => byte.Parse(s, System.Globalization.NumberStyles.HexNumber)).ToArray(); // CMND
byte[] b_nog = "00:d2:00:00:00".Split(':').Select(s => byte.Parse(s, System.Globalization.NumberStyles.HexNumber)).ToArray(); // 0x00d20000
byte[] b_nog = "00:d2:00:00".Split(':').Select(s => byte.Parse(s, System.Globalization.NumberStyles.HexNumber)).ToArray(); // 0x00d20000
byte[] b_command = Encoding.ASCII.GetBytes(message);
byte[] b_padding = {
00,
00
};
byte[] b_length = BitConverter.GetBytes(message.Length + 12 + 1);
00,
00
};
byte[] b_length = BitConverter.GetBytes((message.Length + 12 + 1));
byte[] b_terminator = {
00
};
00
};

Array.Reverse(b_length); // flip flop

Expand Down

0 comments on commit 1252c58

Please sign in to comment.