Skip to content

Commit

Permalink
#6 Update int to uint to increase range of values
Browse files Browse the repository at this point in the history
  • Loading branch information
krugertech committed Aug 18, 2024
1 parent 10d7ce5 commit 4f1b588
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions Smart.Net/Controllers/WmiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public static DriveCollection GetSmartInformation()
Model = device["Model"]?.ToString().Trim(),
Type = device["InterfaceType"]?.ToString().Trim(),
Serial = device["SerialNumber"]?.ToString().Trim()

};

#endregion
Expand Down Expand Up @@ -108,9 +107,9 @@ public static DriveCollection GetSmartInformation()
bool failureImminent = (flags & 0x1) == 0x1;
//bool onlineDataCollection = (flags & 0x2) == 0x2;

int value = bytes[i * 12 + 5];
int worst = bytes[i * 12 + 6];
int vendordata = BitConverter.ToInt32(bytes, i * 12 + 7);
uint value = bytes[i * 12 + 5];
uint worst = bytes[i * 12 + 6];
uint vendordata = BitConverter.ToUInt32(bytes, i * 12 + 7);
if (id == 0) continue;

var attr = drive.SmartAttributes.GetAttribute(id);
Expand Down Expand Up @@ -140,7 +139,7 @@ public static DriveCollection GetSmartInformation()
try
{
int id = bytes[i * 12 + 2];
int thresh = bytes[i * 12 + 3];
uint thresh = bytes[i * 12 + 3];
if (id == 0) continue;

var attr = drive.SmartAttributes.GetAttribute(id);
Expand Down
8 changes: 4 additions & 4 deletions Smart.Net/Objects/SmartAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public SmartAttribute(int register, string attributeName)
public int Register { get; set; }
public string Name { get; set; }

public int Current { get; set; }
public int Worst { get; set; }
public int Threshold { get; set; }
public int Data { get; set; }
public uint Current { get; set; }
public uint Worst { get; set; }
public uint Threshold { get; set; }
public uint Data { get; set; }
public bool IsOK { get; set; }

public bool HasData
Expand Down

0 comments on commit 4f1b588

Please sign in to comment.