2010-01-29 19:20:44 +00:00
|
|
|
/*
|
2010-01-26 22:37:48 +00:00
|
|
|
|
|
|
|
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
for the specific language governing rights and limitations under the License.
|
|
|
|
|
|
|
|
The Original Code is the Open Hardware Monitor code.
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is
|
|
|
|
Michael Möller <m.moeller@gmx.ch>.
|
2011-03-19 22:55:05 +00:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2009-2011
|
2010-01-26 22:37:48 +00:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
|
|
|
Alternatively, the contents of this file may be used under the terms of
|
|
|
|
either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
of those above. If you wish to allow use of your version of this file only
|
|
|
|
under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
use your version of this file under the terms of the MPL, indicate your
|
|
|
|
decision by deleting the provisions above and replace them with the notice
|
|
|
|
and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
the provisions above, a recipient may use your version of this file under
|
|
|
|
the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
2010-06-07 20:03:48 +00:00
|
|
|
using System.IO;
|
2010-01-26 22:37:48 +00:00
|
|
|
using System.Management;
|
|
|
|
using System.Text;
|
|
|
|
|
2010-02-27 20:08:13 +00:00
|
|
|
namespace OpenHardwareMonitor.Hardware.Mainboard {
|
2010-01-26 22:37:48 +00:00
|
|
|
|
2010-08-08 13:57:26 +00:00
|
|
|
internal class SMBIOS {
|
2010-01-26 22:37:48 +00:00
|
|
|
|
2010-09-21 20:32:36 +00:00
|
|
|
private readonly byte[] raw;
|
|
|
|
private readonly Structure[] table;
|
2010-01-26 22:37:48 +00:00
|
|
|
|
2010-11-13 20:20:03 +00:00
|
|
|
private readonly Version version;
|
2010-09-21 20:32:36 +00:00
|
|
|
private readonly BIOSInformation biosInformation;
|
|
|
|
private readonly BaseBoardInformation baseBoardInformation;
|
2010-01-26 22:37:48 +00:00
|
|
|
|
2010-08-15 14:46:58 +00:00
|
|
|
private static string ReadSysFS(string path) {
|
2010-01-29 19:20:44 +00:00
|
|
|
try {
|
2010-06-07 20:03:48 +00:00
|
|
|
if (File.Exists(path)) {
|
|
|
|
using (StreamReader reader = new StreamReader(path))
|
|
|
|
return reader.ReadLine();
|
|
|
|
} else {
|
|
|
|
return null;
|
2010-02-11 13:22:17 +00:00
|
|
|
}
|
2010-06-07 20:03:48 +00:00
|
|
|
} catch {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public SMBIOS() {
|
2010-09-21 20:32:36 +00:00
|
|
|
int p = (int)Environment.OSVersion.Platform;
|
2010-06-07 20:03:48 +00:00
|
|
|
if ((p == 4) || (p == 128)) {
|
|
|
|
this.raw = null;
|
|
|
|
this.table = null;
|
|
|
|
|
|
|
|
string boardVendor = ReadSysFS("/sys/class/dmi/id/board_vendor");
|
|
|
|
string boardName = ReadSysFS("/sys/class/dmi/id/board_name");
|
|
|
|
string boardVersion = ReadSysFS("/sys/class/dmi/id/board_version");
|
|
|
|
this.baseBoardInformation = new BaseBoardInformation(
|
|
|
|
boardVendor, boardName, boardVersion, null);
|
|
|
|
|
|
|
|
string biosVendor = ReadSysFS("/sys/class/dmi/id/bios_vendor");
|
|
|
|
string biosVersion = ReadSysFS("/sys/class/dmi/id/bios_version");
|
|
|
|
this.biosInformation = new BIOSInformation(biosVendor, biosVersion);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
List<Structure> structureList = new List<Structure>();
|
|
|
|
|
|
|
|
raw = null;
|
2010-11-13 20:20:03 +00:00
|
|
|
byte majorVersion = 0;
|
|
|
|
byte minorVersion = 0;
|
2010-06-07 20:03:48 +00:00
|
|
|
try {
|
2010-08-15 14:46:58 +00:00
|
|
|
ManagementObjectCollection collection;
|
|
|
|
using (ManagementObjectSearcher searcher =
|
2010-06-07 20:03:48 +00:00
|
|
|
new ManagementObjectSearcher("root\\WMI",
|
2010-11-13 20:20:03 +00:00
|
|
|
"SELECT * FROM MSSMBios_RawSMBiosTables")) {
|
2010-08-15 14:46:58 +00:00
|
|
|
collection = searcher.Get();
|
|
|
|
}
|
2010-06-07 20:03:48 +00:00
|
|
|
|
|
|
|
foreach (ManagementObject mo in collection) {
|
|
|
|
raw = (byte[])mo["SMBiosData"];
|
2010-11-13 20:20:03 +00:00
|
|
|
majorVersion = (byte)mo["SmbiosMajorVersion"];
|
|
|
|
minorVersion = (byte)mo["SmbiosMinorVersion"];
|
2010-04-05 21:31:21 +00:00
|
|
|
break;
|
2010-06-07 20:03:48 +00:00
|
|
|
}
|
|
|
|
} catch { }
|
2010-11-13 20:20:03 +00:00
|
|
|
|
|
|
|
if (majorVersion > 0 || minorVersion > 0)
|
|
|
|
version = new Version(majorVersion, minorVersion);
|
2010-06-07 20:03:48 +00:00
|
|
|
|
|
|
|
if (raw != null && raw.Length > 0) {
|
|
|
|
int offset = 0;
|
|
|
|
byte type = raw[offset];
|
|
|
|
while (offset + 4 < raw.Length && type != 127) {
|
|
|
|
|
|
|
|
type = raw[offset];
|
|
|
|
int length = raw[offset + 1];
|
|
|
|
ushort handle = (ushort)((raw[offset + 2] << 8) | raw[offset + 3]);
|
|
|
|
|
|
|
|
if (offset + length > raw.Length)
|
|
|
|
break;
|
|
|
|
byte[] data = new byte[length];
|
|
|
|
Array.Copy(raw, offset, data, 0, length);
|
|
|
|
offset += length;
|
|
|
|
|
|
|
|
List<string> stringsList = new List<string>();
|
|
|
|
if (offset < raw.Length && raw[offset] == 0)
|
|
|
|
offset++;
|
|
|
|
|
2010-04-05 21:31:21 +00:00
|
|
|
while (offset < raw.Length && raw[offset] != 0) {
|
2010-06-07 20:03:48 +00:00
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
while (offset < raw.Length && raw[offset] != 0) {
|
|
|
|
sb.Append((char)raw[offset]); offset++;
|
|
|
|
}
|
|
|
|
offset++;
|
|
|
|
stringsList.Add(sb.ToString());
|
2010-01-29 19:20:44 +00:00
|
|
|
}
|
2010-04-05 21:31:21 +00:00
|
|
|
offset++;
|
2010-06-07 20:03:48 +00:00
|
|
|
switch (type) {
|
|
|
|
case 0x00:
|
|
|
|
this.biosInformation = new BIOSInformation(
|
|
|
|
type, handle, data, stringsList.ToArray());
|
|
|
|
structureList.Add(this.biosInformation); break;
|
|
|
|
case 0x02: this.baseBoardInformation = new BaseBoardInformation(
|
|
|
|
type, handle, data, stringsList.ToArray());
|
|
|
|
structureList.Add(this.baseBoardInformation); break;
|
|
|
|
default: structureList.Add(new Structure(
|
|
|
|
type, handle, data, stringsList.ToArray())); break;
|
|
|
|
}
|
2010-01-26 22:37:48 +00:00
|
|
|
}
|
|
|
|
}
|
2010-06-07 20:03:48 +00:00
|
|
|
|
|
|
|
table = structureList.ToArray();
|
2010-04-05 21:31:21 +00:00
|
|
|
}
|
2010-01-26 22:37:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public string GetReport() {
|
2010-06-07 20:03:48 +00:00
|
|
|
StringBuilder r = new StringBuilder();
|
2010-01-26 22:37:48 +00:00
|
|
|
|
2010-11-13 20:20:03 +00:00
|
|
|
if (version != null) {
|
|
|
|
r.Append("SMBIOS Version: "); r.AppendLine(version.ToString(2));
|
|
|
|
r.AppendLine();
|
|
|
|
}
|
|
|
|
|
2010-08-15 14:46:58 +00:00
|
|
|
if (BIOS != null) {
|
|
|
|
r.Append("BIOS Vendor: "); r.AppendLine(BIOS.Vendor);
|
|
|
|
r.Append("BIOS Version: "); r.AppendLine(BIOS.Version);
|
2010-01-26 22:37:48 +00:00
|
|
|
r.AppendLine();
|
|
|
|
}
|
|
|
|
|
2010-08-15 14:46:58 +00:00
|
|
|
if (Board != null) {
|
2010-06-07 20:03:48 +00:00
|
|
|
r.Append("Mainboard Manufacturer: ");
|
2010-08-15 14:46:58 +00:00
|
|
|
r.AppendLine(Board.ManufacturerName);
|
2010-06-07 20:03:48 +00:00
|
|
|
r.Append("Mainboard Name: ");
|
2010-08-15 14:46:58 +00:00
|
|
|
r.AppendLine(Board.ProductName);
|
|
|
|
r.Append("Mainboard Version: ");
|
|
|
|
r.AppendLine(Board.Version);
|
2010-01-26 22:37:48 +00:00
|
|
|
r.AppendLine();
|
|
|
|
}
|
2010-06-07 20:03:48 +00:00
|
|
|
|
|
|
|
if (raw != null) {
|
|
|
|
string base64 = Convert.ToBase64String(raw);
|
|
|
|
r.AppendLine("SMBIOS Table");
|
|
|
|
r.AppendLine();
|
|
|
|
|
|
|
|
for (int i = 0; i < Math.Ceiling(base64.Length / 64.0); i++) {
|
|
|
|
r.Append(" ");
|
|
|
|
for (int j = 0; j < 0x40; j++) {
|
|
|
|
int index = (i << 6) | j;
|
|
|
|
if (index < base64.Length) {
|
|
|
|
r.Append(base64[index]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
r.AppendLine();
|
|
|
|
}
|
|
|
|
r.AppendLine();
|
|
|
|
}
|
|
|
|
|
2010-01-26 22:37:48 +00:00
|
|
|
return r.ToString();
|
|
|
|
}
|
|
|
|
|
2010-02-27 20:08:13 +00:00
|
|
|
public BIOSInformation BIOS {
|
|
|
|
get { return biosInformation; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public BaseBoardInformation Board {
|
|
|
|
get { return baseBoardInformation; }
|
|
|
|
}
|
2010-01-26 22:37:48 +00:00
|
|
|
|
|
|
|
public class Structure {
|
2010-09-21 20:32:36 +00:00
|
|
|
private readonly byte type;
|
|
|
|
private readonly ushort handle;
|
2010-01-26 22:37:48 +00:00
|
|
|
|
2010-09-21 20:32:36 +00:00
|
|
|
private readonly byte[] data;
|
|
|
|
private readonly string[] strings;
|
2010-01-26 22:37:48 +00:00
|
|
|
|
2010-01-29 20:05:32 +00:00
|
|
|
protected string GetString(int offset) {
|
|
|
|
if (offset < data.Length && data[offset] > 0 &&
|
|
|
|
data[offset] <= strings.Length)
|
|
|
|
return strings[data[offset] - 1];
|
|
|
|
else
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2010-01-26 22:37:48 +00:00
|
|
|
public Structure(byte type, ushort handle, byte[] data, string[] strings)
|
|
|
|
{
|
|
|
|
this.type = type;
|
|
|
|
this.handle = handle;
|
|
|
|
this.data = data;
|
|
|
|
this.strings = strings;
|
|
|
|
}
|
|
|
|
|
|
|
|
public byte Type { get { return type; } }
|
|
|
|
|
|
|
|
public ushort Handle { get { return handle; } }
|
|
|
|
}
|
2010-06-07 20:03:48 +00:00
|
|
|
|
2010-01-26 22:37:48 +00:00
|
|
|
public class BIOSInformation : Structure {
|
|
|
|
|
2010-09-21 20:32:36 +00:00
|
|
|
private readonly string vendor;
|
|
|
|
private readonly string version;
|
2010-06-07 20:03:48 +00:00
|
|
|
|
|
|
|
public BIOSInformation(string vendor, string version)
|
|
|
|
: base (0x00, 0, null, null)
|
|
|
|
{
|
|
|
|
this.vendor = vendor;
|
|
|
|
this.version = version;
|
|
|
|
}
|
|
|
|
|
2010-01-26 22:37:48 +00:00
|
|
|
public BIOSInformation(byte type, ushort handle, byte[] data,
|
|
|
|
string[] strings)
|
2010-06-07 20:03:48 +00:00
|
|
|
: base(type, handle, data, strings)
|
|
|
|
{
|
2010-01-29 20:05:32 +00:00
|
|
|
this.vendor = GetString(0x04);
|
|
|
|
this.version = GetString(0x05);
|
2010-01-26 22:37:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public string Vendor { get { return vendor; } }
|
|
|
|
|
|
|
|
public string Version { get { return version; } }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class BaseBoardInformation : Structure {
|
|
|
|
|
2010-09-21 20:32:36 +00:00
|
|
|
private readonly string manufacturerName;
|
|
|
|
private readonly string productName;
|
|
|
|
private readonly string version;
|
|
|
|
private readonly string serialNumber;
|
|
|
|
private readonly Manufacturer manufacturer;
|
|
|
|
private readonly Model model;
|
2010-01-26 22:37:48 +00:00
|
|
|
|
2010-09-21 20:32:36 +00:00
|
|
|
private static Manufacturer GetManufacturer(string name) {
|
2010-08-15 14:46:58 +00:00
|
|
|
switch (name) {
|
2011-05-23 18:14:25 +00:00
|
|
|
case "Alienware":
|
|
|
|
return Manufacturer.Alienware;
|
|
|
|
case "Apple Inc.":
|
|
|
|
return Manufacturer.Apple;
|
2010-07-11 21:26:49 +00:00
|
|
|
case "ASRock":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.ASRock;
|
2010-02-27 20:08:13 +00:00
|
|
|
case "ASUSTeK Computer INC.":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.ASUS;
|
2010-07-11 15:52:50 +00:00
|
|
|
case "Dell Inc.":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.Dell;
|
2010-02-27 20:08:13 +00:00
|
|
|
case "DFI":
|
2010-03-04 20:26:56 +00:00
|
|
|
case "DFI Inc.":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.DFI;
|
2010-09-07 17:52:43 +00:00
|
|
|
case "ECS":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.ECS;
|
2010-02-27 20:08:13 +00:00
|
|
|
case "EPoX COMPUTER CO., LTD":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.EPoX;
|
2010-06-05 11:15:16 +00:00
|
|
|
case "EVGA":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.EVGA;
|
2010-07-11 15:52:50 +00:00
|
|
|
case "First International Computer, Inc.":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.FIC;
|
2011-05-23 18:14:25 +00:00
|
|
|
case "FUJITSU":
|
|
|
|
case "FUJITSU SIEMENS":
|
|
|
|
return Manufacturer.Fujitsu;
|
2010-02-27 20:08:13 +00:00
|
|
|
case "Gigabyte Technology Co., Ltd.":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.Gigabyte;
|
2010-07-11 15:52:50 +00:00
|
|
|
case "Hewlett-Packard":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.HP;
|
2010-03-04 20:26:56 +00:00
|
|
|
case "IBM":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.IBM;
|
2011-05-23 18:14:25 +00:00
|
|
|
case "Intel":
|
|
|
|
case "Intel Corp.":
|
|
|
|
case "Intel Corporation":
|
|
|
|
case "INTEL Corporation":
|
|
|
|
return Manufacturer.Intel;
|
|
|
|
case "Lenovo":
|
|
|
|
case "LENOVO":
|
|
|
|
return Manufacturer.Lenovo;
|
|
|
|
case "Micro-Star International":
|
2010-02-27 20:08:13 +00:00
|
|
|
case "MICRO-STAR INTERNATIONAL CO., LTD":
|
2010-03-04 20:26:56 +00:00
|
|
|
case "MICRO-STAR INTERNATIONAL CO.,LTD":
|
2011-05-23 18:14:25 +00:00
|
|
|
case "MSI":
|
2011-08-02 21:05:17 +00:00
|
|
|
return Manufacturer.MSI;
|
|
|
|
case "Shuttle":
|
|
|
|
return Manufacturer.Shuttle;
|
2011-05-23 18:14:25 +00:00
|
|
|
case "Supermicro":
|
|
|
|
return Manufacturer.Supermicro;
|
|
|
|
case "TOSHIBA":
|
|
|
|
return Manufacturer.Toshiba;
|
2010-07-11 15:52:50 +00:00
|
|
|
case "XFX":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.XFX;
|
2010-07-11 15:52:50 +00:00
|
|
|
case "To be filled by O.E.M.":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.Unknown;
|
2010-02-27 20:08:13 +00:00
|
|
|
default:
|
2010-09-21 20:32:36 +00:00
|
|
|
return Manufacturer.Unknown;
|
2010-05-24 15:27:46 +00:00
|
|
|
}
|
2010-06-07 20:03:48 +00:00
|
|
|
}
|
2010-09-21 20:32:36 +00:00
|
|
|
|
|
|
|
private static Model GetModel(string name) {
|
2010-08-15 14:46:58 +00:00
|
|
|
switch (name) {
|
2010-07-11 21:26:49 +00:00
|
|
|
case "880GMH/USB3":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model._880GMH_USB3;
|
2010-10-11 20:37:37 +00:00
|
|
|
case "ASRock AOD790GX/128M":
|
|
|
|
return Model.AOD790GX_128M;
|
2010-10-14 16:52:23 +00:00
|
|
|
case "P55 Deluxe":
|
|
|
|
return Model.P55_Deluxe;
|
2010-06-05 18:59:54 +00:00
|
|
|
case "Crosshair III Formula":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.Crosshair_III_Formula;
|
2010-06-05 18:59:54 +00:00
|
|
|
case "M2N-SLI DELUXE":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.M2N_SLI_DELUXE;
|
2010-06-27 20:49:29 +00:00
|
|
|
case "M4A79XTD EVO":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.M4A79XTD_EVO;
|
2010-06-03 22:40:18 +00:00
|
|
|
case "P5W DH Deluxe":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.P5W_DH_Deluxe;
|
2010-07-11 15:52:50 +00:00
|
|
|
case "P6X58D-E":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.P6X58D_E;
|
2011-07-24 12:17:17 +00:00
|
|
|
case "P8P67":
|
|
|
|
return Model.P8P67;
|
2011-07-24 11:29:26 +00:00
|
|
|
case "P8P67 EVO":
|
|
|
|
return Model.P8P67_EVO;
|
2011-03-19 22:55:05 +00:00
|
|
|
case "P8P67 PRO":
|
|
|
|
return Model.P8P67_PRO;
|
2011-04-30 21:01:54 +00:00
|
|
|
case "P8P67-M PRO":
|
|
|
|
return Model.P8P67_M_PRO;
|
2010-08-24 20:14:54 +00:00
|
|
|
case "Rampage Extreme":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.Rampage_Extreme;
|
2010-08-24 20:14:54 +00:00
|
|
|
case "Rampage II GENE":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.Rampage_II_GENE;
|
2010-05-24 15:27:46 +00:00
|
|
|
case "LP BI P45-T2RS Elite":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.LP_BI_P45_T2RS_Elite;
|
2010-05-24 15:27:46 +00:00
|
|
|
case "LP DK P55-T3eH9":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.LP_DK_P55_T3eH9;
|
2010-09-07 17:52:43 +00:00
|
|
|
case "A890GXM-A":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.A890GXM_A;
|
2010-06-05 11:15:16 +00:00
|
|
|
case "X58 SLI Classified":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.X58_SLI_Classified;
|
2010-06-03 22:40:18 +00:00
|
|
|
case "965P-S3":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model._965P_S3;
|
2010-05-24 15:27:46 +00:00
|
|
|
case "EP45-DS3R":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.EP45_DS3R;
|
2010-06-03 22:40:18 +00:00
|
|
|
case "EP45-UD3R":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.EP45_UD3R;
|
2010-06-05 18:59:54 +00:00
|
|
|
case "EX58-EXTREME":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.EX58_EXTREME;
|
2010-07-14 21:10:26 +00:00
|
|
|
case "GA-MA770T-UD3":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.GA_MA770T_UD3;
|
2010-05-24 15:27:46 +00:00
|
|
|
case "GA-MA785GMT-UD2H":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.GA_MA785GMT_UD2H;
|
2011-05-18 19:58:57 +00:00
|
|
|
case "H67A-UD3H-B3":
|
|
|
|
return Model.H67A_UD3H_B3;
|
2010-05-24 15:27:46 +00:00
|
|
|
case "P35-DS3":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.P35_DS3;
|
2010-06-05 18:59:54 +00:00
|
|
|
case "P35-DS3L":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.P35_DS3L;
|
2010-07-01 20:25:38 +00:00
|
|
|
case "P55-UD4":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.P55_UD4;
|
2010-08-15 17:56:57 +00:00
|
|
|
case "P55M-UD4":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.P55M_UD4;
|
2011-05-03 18:20:06 +00:00
|
|
|
case "P67A-UD4-B3":
|
|
|
|
return Model.P67A_UD4_B3;
|
2010-06-03 22:40:18 +00:00
|
|
|
case "X38-DS5":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.X38_DS5;
|
2010-06-08 21:07:13 +00:00
|
|
|
case "X58A-UD3R":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.X58A_UD3R;
|
2011-06-26 16:00:20 +00:00
|
|
|
case "Z68X-UD7-B3":
|
|
|
|
return Model.Z68X_UD7_B3;
|
2011-05-23 18:14:25 +00:00
|
|
|
case "Base Board Product Name":
|
2010-07-11 15:52:50 +00:00
|
|
|
case "To be filled by O.E.M.":
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.Unknown;
|
2010-05-24 15:27:46 +00:00
|
|
|
default:
|
2010-09-21 20:32:36 +00:00
|
|
|
return Model.Unknown;
|
2010-02-27 20:08:13 +00:00
|
|
|
}
|
2010-01-26 22:37:48 +00:00
|
|
|
}
|
2010-06-07 20:03:48 +00:00
|
|
|
|
|
|
|
public BaseBoardInformation(string manufacturerName, string productName,
|
|
|
|
string version, string serialNumber)
|
|
|
|
: base(0x02, 0, null, null)
|
2010-09-21 20:32:36 +00:00
|
|
|
{
|
|
|
|
this.manufacturerName = manufacturerName;
|
|
|
|
this.manufacturer = GetManufacturer(manufacturerName);
|
|
|
|
this.productName = productName;
|
|
|
|
this.model = GetModel(productName);
|
2010-06-07 20:03:48 +00:00
|
|
|
this.version = version;
|
|
|
|
this.serialNumber = serialNumber;
|
|
|
|
}
|
|
|
|
|
|
|
|
public BaseBoardInformation(byte type, ushort handle, byte[] data,
|
|
|
|
string[] strings)
|
|
|
|
: base(type, handle, data, strings) {
|
2010-01-26 22:37:48 +00:00
|
|
|
|
2010-09-21 20:32:36 +00:00
|
|
|
this.manufacturerName = GetString(0x04).Trim();
|
|
|
|
this.manufacturer = GetManufacturer(this.manufacturerName);
|
|
|
|
this.productName = GetString(0x05).Trim();
|
|
|
|
this.model = GetModel(this.productName);
|
2010-06-07 20:03:48 +00:00
|
|
|
this.version = GetString(0x06).Trim();
|
|
|
|
this.serialNumber = GetString(0x07).Trim();
|
|
|
|
}
|
|
|
|
|
2010-02-27 20:08:13 +00:00
|
|
|
public string ManufacturerName { get { return manufacturerName; } }
|
2010-01-26 22:37:48 +00:00
|
|
|
|
|
|
|
public string ProductName { get { return productName; } }
|
2010-02-27 20:08:13 +00:00
|
|
|
|
2010-04-05 21:31:21 +00:00
|
|
|
public string Version { get { return version; } }
|
|
|
|
|
|
|
|
public string SerialNumber { get { return serialNumber; } }
|
|
|
|
|
2010-02-27 20:08:13 +00:00
|
|
|
public Manufacturer Manufacturer { get { return manufacturer; } }
|
2010-04-05 21:31:21 +00:00
|
|
|
|
2010-05-24 15:27:46 +00:00
|
|
|
public Model Model { get { return model; } }
|
|
|
|
|
2010-01-26 22:37:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|