# HG changeset patch # User moel.mich # Date 1266181748 0 # Node ID eadad41d21a67177dea769cedb1eec755aaa9df9 # Parent c150de283ca029a9d08c8a715cdb9ac94e7136b6 Allow all protocols 2X for T-Balancer. diff -r c150de283ca0 -r eadad41d21a6 Hardware/TBalancer/TBalancer.cs --- a/Hardware/TBalancer/TBalancer.cs Sun Feb 14 20:16:30 2010 +0000 +++ b/Hardware/TBalancer/TBalancer.cs Sun Feb 14 21:09:08 2010 +0000 @@ -57,8 +57,6 @@ private int[] data; public const byte STARTFLAG = 100; - public const byte PROTOCOL_VERSION_2A = 0x2A; - public const byte PROTOCOL_VERSION_2C = 0x2C; public TBalancer(string portName, byte protocolVersion) { icon = Utilities.EmbeddedResources.GetImage("bigng.png"); diff -r c150de283ca0 -r eadad41d21a6 Hardware/TBalancer/TBalancerGroup.cs --- a/Hardware/TBalancer/TBalancerGroup.cs Sun Feb 14 20:16:30 2010 +0000 +++ b/Hardware/TBalancer/TBalancerGroup.cs Sun Feb 14 21:09:08 2010 +0000 @@ -83,10 +83,8 @@ for (int k = 1; k < data.Length; k++) data[k] = (byte)serialPort.ReadByte(); - // check protocol version - isValid = - data[274] == TBalancer.PROTOCOL_VERSION_2A || - data[274] == TBalancer.PROTOCOL_VERSION_2C; + // check protocol version 2X (protocols seen: 2C, 2A, 28) + isValid = (data[274] & 0xF0) == 0x20; protocolVersion = data[274]; if (!isValid) { report.Append("Status: Wrong Protocol Version: 0x"); @@ -131,7 +129,8 @@ public string GetReport() { if (report.Length > 0) { report.Insert(0, "Serial Port T-Balancer" + Environment.NewLine + - Environment.NewLine); + Environment.NewLine); + report.AppendLine(); return report.ToString(); } else return null; diff -r c150de283ca0 -r eadad41d21a6 Properties/AssemblyInfo.cs --- a/Properties/AssemblyInfo.cs Sun Feb 14 20:16:30 2010 +0000 +++ b/Properties/AssemblyInfo.cs Sun Feb 14 21:09:08 2010 +0000 @@ -69,5 +69,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.20.0")] -[assembly: AssemblyFileVersion("0.1.20.0")] +[assembly: AssemblyVersion("0.1.20.1")] +[assembly: AssemblyFileVersion("0.1.20.1")]