mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-29 13:28:04 +00:00
Restored CTSHolding check and added more report output for T-Balancer enumeration.
This commit is contained in:
parent
dc9108ade1
commit
b43e33cb4f
@ -162,7 +162,7 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
|
||||
foreach (IGroup group in groups) {
|
||||
string report = group.GetReport();
|
||||
if (report != null) {
|
||||
if (report != null && report != "") {
|
||||
NewSection(w);
|
||||
w.Write(report);
|
||||
}
|
||||
@ -170,7 +170,7 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
IHardware[] hardwareArray = group.Hardware;
|
||||
foreach (IHardware hardware in hardwareArray) {
|
||||
string hardwareReport = hardware.GetReport();
|
||||
if (hardwareReport != null) {
|
||||
if (hardwareReport != null && hardwareReport != "") {
|
||||
NewSection(w);
|
||||
w.Write(hardwareReport);
|
||||
}
|
||||
|
@ -56,12 +56,19 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
|
||||
SerialPort serialPort =
|
||||
new SerialPort(portNames[i], 19200, Parity.None, 8, StopBits.One);
|
||||
serialPort.Open();
|
||||
|
||||
bool isValid = false;
|
||||
byte protocolVersion = 0;
|
||||
report.Append("Port Name: "); report.AppendLine(portNames[i]);
|
||||
|
||||
try {
|
||||
serialPort.Open();
|
||||
} catch (UnauthorizedAccessException) {
|
||||
report.AppendLine("Exception: Access Denied");
|
||||
}
|
||||
|
||||
if (serialPort.IsOpen) {
|
||||
if (serialPort.CtsHolding) {
|
||||
serialPort.DiscardInBuffer();
|
||||
serialPort.DiscardOutBuffer();
|
||||
serialPort.Write(new byte[] { 0x38 }, 0, 1);
|
||||
@ -100,10 +107,13 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
report.AppendLine("Status: No Response");
|
||||
}
|
||||
} else {
|
||||
report.AppendLine("Status: Port not Open");
|
||||
report.AppendLine("Status: Not Clear to Send");
|
||||
}
|
||||
serialPort.DiscardInBuffer();
|
||||
serialPort.Close();
|
||||
} else {
|
||||
report.AppendLine("Status: Port not Open");
|
||||
}
|
||||
if (isValid) {
|
||||
report.AppendLine("Status: OK");
|
||||
hardware.Add(new TBalancer(portNames[i], protocolVersion));
|
||||
@ -111,8 +121,6 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
report.AppendLine(ioe.ToString());
|
||||
} catch (UnauthorizedAccessException uae) {
|
||||
report.AppendLine(uae.ToString());
|
||||
} catch (NullReferenceException ne) {
|
||||
report.AppendLine(ne.ToString());
|
||||
}
|
||||
|
@ -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.21.0")]
|
||||
[assembly: AssemblyFileVersion("0.1.21.0")]
|
||||
[assembly: AssemblyVersion("0.1.21.1")]
|
||||
[assembly: AssemblyFileVersion("0.1.21.1")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user