From fb418a9c1c123b3e802fde86857568f569506832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Wed, 17 Feb 2010 18:48:27 +0000 Subject: [PATCH] Added additional SMART temperature attributes. --- Hardware/HDD/HDDGroup.cs | 16 ++++++++++++++-- Hardware/HDD/SMART.cs | 4 +++- Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Hardware/HDD/HDDGroup.cs b/Hardware/HDD/HDDGroup.cs index 132fad8..fab5a3c 100644 --- a/Hardware/HDD/HDDGroup.cs +++ b/Hardware/HDD/HDDGroup.cs @@ -67,12 +67,24 @@ namespace OpenHardwareMonitor.Hardware.HDD { continue; int attribute = -1; - for (int i = 0; i < attributes.Length; i++) { + for (int i = 0; i < attributes.Length; i++) if (attributes[i].ID == SMART.AttributeID.Temperature) { attribute = i; break; } - } + if (attribute == -1) + for (int i = 0; i < attributes.Length; i++) + if (attributes[i].ID == SMART.AttributeID.DriveTemperature) { + attribute = i; + break; + } + if (attribute == -1) + for (int i = 0; i < attributes.Length; i++) + if (attributes[i].ID == SMART.AttributeID.AirflowTemperature) + { + attribute = i; + break; + } if (attribute >= 0) { hardware.Add(new HDD(name, handle, drive, attribute)); diff --git a/Hardware/HDD/SMART.cs b/Hardware/HDD/SMART.cs index 3ce5676..77e0946 100644 --- a/Hardware/HDD/SMART.cs +++ b/Hardware/HDD/SMART.cs @@ -67,13 +67,15 @@ namespace OpenHardwareMonitor.Hardware.HDD { RecalibrationRetries = 0x0B, PowerCycleCount = 0x0C, SoftReadErrorRate = 0x0D, + AirflowTemperature = 0xBE, Temperature = 0xC2, HardwareECCRecovered = 0xC3, ReallocationEventCount = 0xC4, CurrentPendingSectorCount = 0xC5, UncorrectableSectorCount = 0xC6, UltraDMACRCErrorCount = 0xC7, - WriteErrorRate = 0xC8 + WriteErrorRate = 0xC8, + DriveTemperature = 0xE7 } [StructLayout(LayoutKind.Sequential, Pack = 1)] diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 7bb63bc..cca268b 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -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.1")] -[assembly: AssemblyFileVersion("0.1.21.1")] +[assembly: AssemblyVersion("0.1.21.2")] +[assembly: AssemblyFileVersion("0.1.21.2")]