moel@328: /* moel@328: moel@344: This Source Code Form is subject to the terms of the Mozilla Public moel@344: License, v. 2.0. If a copy of the MPL was not distributed with this moel@344: file, You can obtain one at http://mozilla.org/MPL/2.0/. moel@328: moel@406: Copyright (C) 2012-2013 Michael Möller moel@344: moel@328: */ moel@328: moel@328: namespace OpenHardwareMonitor.Hardware.HDD { moel@328: using System.Collections.Generic; moel@406: using OpenHardwareMonitor.Collections; moel@328: moel@406: [NamePrefix(""), RequireSmart(0xB1), RequireSmart(0xB3), RequireSmart(0xB5), moel@406: RequireSmart(0xB6), RequireSmart(0xB7), RequireSmart(0xBB), moel@406: RequireSmart(0xC3), RequireSmart(0xC7)] moel@328: internal class SSDSamsung : AbstractHarddrive { moel@328: moel@328: private static readonly IEnumerable smartAttributes = moel@328: new List { moel@406: new SmartAttribute(0x05, SmartNames.ReallocatedSectorsCount), moel@328: new SmartAttribute(0x09, SmartNames.PowerOnHours, RawToInt), moel@328: new SmartAttribute(0x0C, SmartNames.PowerCycleCount, RawToInt), moel@328: new SmartAttribute(0xAF, SmartNames.ProgramFailCountChip, RawToInt), moel@328: new SmartAttribute(0xB0, SmartNames.EraseFailCountChip, RawToInt), moel@328: new SmartAttribute(0xB1, SmartNames.WearLevelingCount, RawToInt), moel@328: new SmartAttribute(0xB2, SmartNames.UsedReservedBlockCountChip, RawToInt), moel@328: new SmartAttribute(0xB3, SmartNames.UsedReservedBlockCountTotal, RawToInt), moel@328: moel@328: // Unused Reserved Block Count (Total) moel@328: new SmartAttribute(0xB4, SmartNames.RemainingLife, moel@328: null, SensorType.Level, 0), moel@328: moel@328: new SmartAttribute(0xB5, SmartNames.ProgramFailCountTotal, RawToInt), moel@328: new SmartAttribute(0xB6, SmartNames.EraseFailCountTotal, RawToInt), moel@328: new SmartAttribute(0xB7, SmartNames.RuntimeBadBlockTotal, RawToInt), moel@328: new SmartAttribute(0xBB, SmartNames.UncorrectableErrorCount, RawToInt), moel@406: new SmartAttribute(0xBE, SmartNames.Temperature, moel@406: (byte[] r, byte v, IReadOnlyArray p) moel@406: => { return r[0] + (p == null ? 0 : p[0].Value); }, moel@406: SensorType.Temperature, 0, false, moel@406: new[] { new ParameterDescription("Offset [°C]", moel@406: "Temperature offset of the thermal sensor.\n" + moel@406: "Temperature = Value + Offset.", 0) }), moel@328: new SmartAttribute(0xC2, SmartNames.AirflowTemperature), moel@328: new SmartAttribute(0xC3, SmartNames.ECCRate), moel@328: new SmartAttribute(0xC6, SmartNames.OffLineUncorrectableErrorCount, RawToInt), moel@328: new SmartAttribute(0xC7, SmartNames.CRCErrorCount, RawToInt), moel@328: new SmartAttribute(0xC9, SmartNames.SupercapStatus), moel@406: new SmartAttribute(0xCA, SmartNames.ExceptionModeStatus), moel@406: new SmartAttribute(0xEB, SmartNames.PowerRecoveryCount), moel@406: new SmartAttribute(0xF1, SmartNames.TotalLBAWritten) moel@328: }; moel@328: moel@328: public SSDSamsung(ISmart smart, string name, string firmwareRevision, moel@328: int index, ISettings settings) moel@328: : base(smart, name, firmwareRevision, index, smartAttributes, settings) { } moel@328: } moel@328: }