mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-09-03 15:55:26 +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;
|
private int[] data;
|
||||||
|
|
||||||
public const byte STARTFLAG = 100;
|
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) {
|
public TBalancer(string portName, byte protocolVersion) {
|
||||||
icon = Utilities.EmbeddedResources.GetImage("bigng.png");
|
icon = Utilities.EmbeddedResources.GetImage("bigng.png");
|
||||||
|
@@ -83,10 +83,8 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
|||||||
for (int k = 1; k < data.Length; k++)
|
for (int k = 1; k < data.Length; k++)
|
||||||
data[k] = (byte)serialPort.ReadByte();
|
data[k] = (byte)serialPort.ReadByte();
|
||||||
|
|
||||||
// check protocol version
|
// check protocol version 2X (protocols seen: 2C, 2A, 28)
|
||||||
isValid =
|
isValid = (data[274] & 0xF0) == 0x20;
|
||||||
data[274] == TBalancer.PROTOCOL_VERSION_2A ||
|
|
||||||
data[274] == TBalancer.PROTOCOL_VERSION_2C;
|
|
||||||
protocolVersion = data[274];
|
protocolVersion = data[274];
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
report.Append("Status: Wrong Protocol Version: 0x");
|
report.Append("Status: Wrong Protocol Version: 0x");
|
||||||
@@ -131,7 +129,8 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
|||||||
public string GetReport() {
|
public string GetReport() {
|
||||||
if (report.Length > 0) {
|
if (report.Length > 0) {
|
||||||
report.Insert(0, "Serial Port T-Balancer" + Environment.NewLine +
|
report.Insert(0, "Serial Port T-Balancer" + Environment.NewLine +
|
||||||
Environment.NewLine);
|
Environment.NewLine);
|
||||||
|
report.AppendLine();
|
||||||
return report.ToString();
|
return report.ToString();
|
||||||
} else
|
} else
|
||||||
return null;
|
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
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.1.20.0")]
|
[assembly: AssemblyVersion("0.1.20.1")]
|
||||||
[assembly: AssemblyFileVersion("0.1.20.0")]
|
[assembly: AssemblyFileVersion("0.1.20.1")]
|
||||||
|
Reference in New Issue
Block a user