mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-31 06:15:08 +00:00
Allow all protocols 2X for T-Balancer.
This commit is contained in:
@@ -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");
|
||||
|
@@ -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;
|
||||
|
@@ -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")]
|
||||
|
Reference in New Issue
Block a user