Allow all protocols 2X for T-Balancer.

This commit is contained in:
Michael Möller
2010-02-14 21:09:08 +00:00
parent f10c7cb524
commit e3a64e9a06
3 changed files with 6 additions and 9 deletions

View File

@@ -57,8 +57,6 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
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");

View File

@@ -83,10 +83,8 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
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 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
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;

View File

@@ -69,5 +69,5 @@ using System.Runtime.InteropServices;
// 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")]