Hardware/Mainboard/SMBIOS.cs
author moel.mich
Fri, 20 Jan 2012 17:19:42 +0000
changeset 337 10283dd68bbb
parent 336 1966500884bc
child 344 3145aadca3d2
permissions -rw-r--r--
Added a mainboard specific configuration for the ASUS P8Z68-V PRO.
moel@64
     1
/*
moel@64
     2
  
moel@64
     3
  Version: MPL 1.1/GPL 2.0/LGPL 2.1
moel@64
     4
moel@64
     5
  The contents of this file are subject to the Mozilla Public License Version
moel@64
     6
  1.1 (the "License"); you may not use this file except in compliance with
moel@64
     7
  the License. You may obtain a copy of the License at
moel@64
     8
 
moel@64
     9
  http://www.mozilla.org/MPL/
moel@64
    10
moel@64
    11
  Software distributed under the License is distributed on an "AS IS" basis,
moel@64
    12
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
moel@64
    13
  for the specific language governing rights and limitations under the License.
moel@64
    14
moel@64
    15
  The Original Code is the Open Hardware Monitor code.
moel@64
    16
moel@64
    17
  The Initial Developer of the Original Code is 
moel@64
    18
  Michael Möller <m.moeller@gmx.ch>.
moel@332
    19
  Portions created by the Initial Developer are Copyright (C) 2009-2012
moel@64
    20
  the Initial Developer. All Rights Reserved.
moel@64
    21
moel@64
    22
  Contributor(s):
moel@64
    23
moel@64
    24
  Alternatively, the contents of this file may be used under the terms of
moel@64
    25
  either the GNU General Public License Version 2 or later (the "GPL"), or
moel@64
    26
  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
moel@64
    27
  in which case the provisions of the GPL or the LGPL are applicable instead
moel@64
    28
  of those above. If you wish to allow use of your version of this file only
moel@64
    29
  under the terms of either the GPL or the LGPL, and not to allow others to
moel@64
    30
  use your version of this file under the terms of the MPL, indicate your
moel@64
    31
  decision by deleting the provisions above and replace them with the notice
moel@64
    32
  and other provisions required by the GPL or the LGPL. If you do not delete
moel@64
    33
  the provisions above, a recipient may use your version of this file under
moel@64
    34
  the terms of any one of the MPL, the GPL or the LGPL.
moel@64
    35
 
moel@64
    36
*/
moel@64
    37
moel@64
    38
using System;
moel@64
    39
using System.Collections.Generic;
moel@136
    40
using System.IO;
moel@64
    41
using System.Management;
moel@64
    42
using System.Text;
moel@64
    43
moel@64
    44
namespace OpenHardwareMonitor.Hardware.Mainboard {
moel@64
    45
moel@165
    46
  internal class SMBIOS {
moel@64
    47
moel@195
    48
    private readonly byte[] raw;
moel@195
    49
    private readonly Structure[] table;
moel@64
    50
moel@242
    51
    private readonly Version version;
moel@195
    52
    private readonly BIOSInformation biosInformation;
moel@320
    53
    private readonly SystemInformation systemInformation;
moel@195
    54
    private readonly BaseBoardInformation baseBoardInformation;
moel@64
    55
moel@167
    56
    private static string ReadSysFS(string path) {
moel@136
    57
      try {
moel@136
    58
        if (File.Exists(path)) {
moel@136
    59
          using (StreamReader reader = new StreamReader(path)) 
moel@136
    60
            return reader.ReadLine();
moel@136
    61
        } else {
moel@136
    62
          return null;
moel@136
    63
        }
moel@136
    64
      } catch {
moel@136
    65
        return null;
moel@136
    66
      }
moel@136
    67
    }
moel@136
    68
    
moel@64
    69
    public SMBIOS() {
moel@195
    70
      int p = (int)Environment.OSVersion.Platform;
moel@136
    71
      if ((p == 4) || (p == 128)) {
moel@136
    72
        this.raw = null;
moel@136
    73
        this.table = null;
moel@136
    74
        
moel@136
    75
        string boardVendor = ReadSysFS("/sys/class/dmi/id/board_vendor");
moel@136
    76
        string boardName = ReadSysFS("/sys/class/dmi/id/board_name");        
moel@136
    77
        string boardVersion = ReadSysFS("/sys/class/dmi/id/board_version");        
moel@136
    78
        this.baseBoardInformation = new BaseBoardInformation(
moel@136
    79
          boardVendor, boardName, boardVersion, null);
moel@320
    80
moel@320
    81
        string systemVendor = ReadSysFS("/sys/class/dmi/id/sys_vendor");
moel@320
    82
        string productName = ReadSysFS("/sys/class/dmi/id/product_name");
moel@320
    83
        string productVersion = ReadSysFS("/sys/class/dmi/id/product_version");    
moel@320
    84
        this.systemInformation = new SystemInformation(systemVendor, 
moel@320
    85
          productName, productVersion, null, null);
moel@320
    86
moel@136
    87
        string biosVendor = ReadSysFS("/sys/class/dmi/id/bios_vendor");
moel@136
    88
        string biosVersion = ReadSysFS("/sys/class/dmi/id/bios_version");
moel@136
    89
        this.biosInformation = new BIOSInformation(biosVendor, biosVersion);
moel@136
    90
        
moel@136
    91
      } else {              
moel@136
    92
        List<Structure> structureList = new List<Structure>();
moel@64
    93
moel@136
    94
        raw = null;
moel@242
    95
        byte majorVersion = 0;
moel@242
    96
        byte minorVersion = 0;
moel@136
    97
        try {
moel@167
    98
          ManagementObjectCollection collection;
moel@167
    99
          using (ManagementObjectSearcher searcher = 
moel@136
   100
            new ManagementObjectSearcher("root\\WMI", 
moel@242
   101
              "SELECT * FROM MSSMBios_RawSMBiosTables")) {
moel@167
   102
            collection = searcher.Get();
moel@167
   103
          }
moel@136
   104
         
moel@136
   105
          foreach (ManagementObject mo in collection) {
moel@136
   106
            raw = (byte[])mo["SMBiosData"];
moel@242
   107
            majorVersion = (byte)mo["SmbiosMajorVersion"];
moel@242
   108
            minorVersion = (byte)mo["SmbiosMinorVersion"];            
moel@89
   109
            break;
moel@136
   110
          }
moel@136
   111
        } catch { }
moel@242
   112
moel@242
   113
        if (majorVersion > 0 || minorVersion > 0)
moel@242
   114
          version = new Version(majorVersion, minorVersion);
moel@136
   115
  
moel@136
   116
        if (raw != null && raw.Length > 0) {
moel@136
   117
          int offset = 0;
moel@136
   118
          byte type = raw[offset];
moel@136
   119
          while (offset + 4 < raw.Length && type != 127) {
moel@136
   120
  
moel@136
   121
            type = raw[offset];
moel@136
   122
            int length = raw[offset + 1];
moel@136
   123
            ushort handle = (ushort)((raw[offset + 2] << 8) | raw[offset + 3]);
moel@136
   124
  
moel@136
   125
            if (offset + length > raw.Length)
moel@136
   126
              break;
moel@136
   127
            byte[] data = new byte[length];
moel@136
   128
            Array.Copy(raw, offset, data, 0, length);
moel@136
   129
            offset += length;
moel@136
   130
  
moel@136
   131
            List<string> stringsList = new List<string>();
moel@136
   132
            if (offset < raw.Length && raw[offset] == 0)
moel@136
   133
              offset++;
moel@136
   134
  
moel@89
   135
            while (offset < raw.Length && raw[offset] != 0) {
moel@136
   136
              StringBuilder sb = new StringBuilder();
moel@136
   137
              while (offset < raw.Length && raw[offset] != 0) {
moel@136
   138
                sb.Append((char)raw[offset]); offset++;
moel@136
   139
              }
moel@136
   140
              offset++;
moel@136
   141
              stringsList.Add(sb.ToString());
moel@64
   142
            }
moel@64
   143
            offset++;
moel@136
   144
            switch (type) {
moel@136
   145
              case 0x00:
moel@136
   146
                this.biosInformation = new BIOSInformation(
moel@136
   147
                  type, handle, data, stringsList.ToArray());
moel@136
   148
                structureList.Add(this.biosInformation); break;
moel@320
   149
              case 0x01:
moel@320
   150
                this.systemInformation = new SystemInformation(
moel@320
   151
                  type, handle, data, stringsList.ToArray());
moel@320
   152
                structureList.Add(this.systemInformation); break;
moel@136
   153
              case 0x02: this.baseBoardInformation = new BaseBoardInformation(
moel@136
   154
                  type, handle, data, stringsList.ToArray());
moel@136
   155
                structureList.Add(this.baseBoardInformation); break;
moel@136
   156
              default: structureList.Add(new Structure(
moel@136
   157
                type, handle, data, stringsList.ToArray())); break;
moel@136
   158
            }
moel@64
   159
          }
moel@64
   160
        }
moel@136
   161
              
moel@136
   162
        table = structureList.ToArray();
moel@89
   163
      }
moel@64
   164
    }
moel@64
   165
moel@64
   166
    public string GetReport() {
moel@136
   167
      StringBuilder r = new StringBuilder();
moel@64
   168
moel@242
   169
      if (version != null) {
moel@242
   170
        r.Append("SMBIOS Version: "); r.AppendLine(version.ToString(2));
moel@242
   171
        r.AppendLine();
moel@242
   172
      }
moel@242
   173
moel@167
   174
      if (BIOS != null) {
moel@167
   175
        r.Append("BIOS Vendor: "); r.AppendLine(BIOS.Vendor);
moel@167
   176
        r.Append("BIOS Version: "); r.AppendLine(BIOS.Version);
moel@64
   177
        r.AppendLine();
moel@64
   178
      }
moel@64
   179
moel@320
   180
      if (System != null) {
moel@320
   181
        r.Append("System Manufacturer: ");
moel@320
   182
        r.AppendLine(System.ManufacturerName);
moel@320
   183
        r.Append("System Name: ");
moel@320
   184
        r.AppendLine(System.ProductName);
moel@320
   185
        r.Append("System Version: ");
moel@320
   186
        r.AppendLine(System.Version);
moel@320
   187
        r.AppendLine();
moel@320
   188
      }
moel@320
   189
moel@167
   190
      if (Board != null) {
moel@136
   191
        r.Append("Mainboard Manufacturer: ");
moel@167
   192
        r.AppendLine(Board.ManufacturerName);
moel@136
   193
        r.Append("Mainboard Name: ");
moel@167
   194
        r.AppendLine(Board.ProductName);
moel@167
   195
        r.Append("Mainboard Version: ");
moel@167
   196
        r.AppendLine(Board.Version);
moel@64
   197
        r.AppendLine();
moel@64
   198
      }
moel@136
   199
moel@136
   200
      if (raw != null) {
moel@136
   201
        string base64 = Convert.ToBase64String(raw);
moel@136
   202
        r.AppendLine("SMBIOS Table");
moel@136
   203
        r.AppendLine();
moel@136
   204
moel@136
   205
        for (int i = 0; i < Math.Ceiling(base64.Length / 64.0); i++) {
moel@136
   206
          r.Append(" ");
moel@136
   207
          for (int j = 0; j < 0x40; j++) {
moel@136
   208
            int index = (i << 6) | j;
moel@136
   209
            if (index < base64.Length) {              
moel@136
   210
              r.Append(base64[index]);
moel@136
   211
            }
moel@136
   212
          }
moel@136
   213
          r.AppendLine();
moel@136
   214
        }
moel@136
   215
        r.AppendLine();
moel@136
   216
      }
moel@136
   217
moel@64
   218
      return r.ToString();
moel@64
   219
    }
moel@64
   220
moel@64
   221
    public BIOSInformation BIOS {
moel@64
   222
      get { return biosInformation; }
moel@64
   223
    }
moel@64
   224
moel@320
   225
    public SystemInformation System {
moel@320
   226
      get { return systemInformation; }
moel@320
   227
    }
moel@320
   228
moel@64
   229
    public BaseBoardInformation Board {
moel@64
   230
      get { return baseBoardInformation; }
moel@64
   231
    }
moel@64
   232
moel@64
   233
    public class Structure {
moel@195
   234
      private readonly byte type;
moel@195
   235
      private readonly ushort handle;
moel@64
   236
moel@195
   237
      private readonly byte[] data;
moel@195
   238
      private readonly string[] strings;
moel@64
   239
moel@64
   240
      protected string GetString(int offset) {
moel@64
   241
        if (offset < data.Length && data[offset] > 0 &&
moel@64
   242
         data[offset] <= strings.Length)
moel@64
   243
          return strings[data[offset] - 1];
moel@64
   244
        else
moel@64
   245
          return "";
moel@64
   246
      }
moel@64
   247
moel@64
   248
      public Structure(byte type, ushort handle, byte[] data, string[] strings) 
moel@64
   249
      {
moel@64
   250
        this.type = type;
moel@64
   251
        this.handle = handle;
moel@64
   252
        this.data = data;
moel@64
   253
        this.strings = strings;
moel@64
   254
      }
moel@64
   255
moel@64
   256
      public byte Type { get { return type; } }
moel@64
   257
moel@64
   258
      public ushort Handle { get { return handle; } }
moel@64
   259
    }
moel@136
   260
      
moel@64
   261
    public class BIOSInformation : Structure {
moel@64
   262
moel@195
   263
      private readonly string vendor;
moel@195
   264
      private readonly string version;
moel@136
   265
      
moel@136
   266
      public BIOSInformation(string vendor, string version) 
moel@136
   267
        : base (0x00, 0, null, null) 
moel@136
   268
      {
moel@136
   269
        this.vendor = vendor;
moel@136
   270
        this.version = version;
moel@136
   271
      }
moel@136
   272
      
moel@64
   273
      public BIOSInformation(byte type, ushort handle, byte[] data,
moel@64
   274
        string[] strings)
moel@136
   275
        : base(type, handle, data, strings) 
moel@136
   276
      {
moel@64
   277
        this.vendor = GetString(0x04);
moel@64
   278
        this.version = GetString(0x05);
moel@64
   279
      }
moel@64
   280
moel@64
   281
      public string Vendor { get { return vendor; } }
moel@64
   282
moel@64
   283
      public string Version { get { return version; } }
moel@64
   284
    }
moel@64
   285
moel@320
   286
    public class SystemInformation : Structure {
moel@320
   287
moel@320
   288
      private readonly string manufacturerName;
moel@320
   289
      private readonly string productName;
moel@320
   290
      private readonly string version;
moel@320
   291
      private readonly string serialNumber;
moel@320
   292
      private readonly string family;
moel@320
   293
moel@320
   294
      public SystemInformation(string manufacturerName, string productName, 
moel@320
   295
        string version, string serialNumber, string family) 
moel@320
   296
        : base (0x01, 0, null, null) 
moel@320
   297
      {
moel@320
   298
        this.manufacturerName = manufacturerName;
moel@320
   299
        this.productName = productName;
moel@320
   300
        this.version = version;
moel@320
   301
        this.serialNumber = serialNumber;
moel@320
   302
        this.family = family;
moel@320
   303
      }
moel@320
   304
moel@320
   305
      public SystemInformation(byte type, ushort handle, byte[] data,
moel@320
   306
        string[] strings)
moel@320
   307
        : base(type, handle, data, strings) 
moel@320
   308
      {
moel@320
   309
        this.manufacturerName = GetString(0x04);
moel@320
   310
        this.productName = GetString(0x05);
moel@320
   311
        this.version = GetString(0x06);
moel@320
   312
        this.serialNumber = GetString(0x07);
moel@320
   313
        this.family = GetString(0x1A);
moel@320
   314
      }
moel@320
   315
moel@320
   316
      public string ManufacturerName { get { return manufacturerName; } }
moel@320
   317
moel@320
   318
      public string ProductName { get { return productName; } }
moel@320
   319
moel@320
   320
      public string Version { get { return version; } }
moel@320
   321
moel@320
   322
      public string SerialNumber { get { return serialNumber; } }
moel@320
   323
moel@320
   324
      public string Family { get { return family; } }
moel@320
   325
moel@320
   326
    }
moel@320
   327
moel@64
   328
    public class BaseBoardInformation : Structure {
moel@64
   329
moel@195
   330
      private readonly string manufacturerName;
moel@195
   331
      private readonly string productName;
moel@195
   332
      private readonly string version;
moel@195
   333
      private readonly string serialNumber;
moel@195
   334
      private readonly Manufacturer manufacturer;
moel@195
   335
      private readonly Model model;
moel@64
   336
moel@195
   337
      private static Manufacturer GetManufacturer(string name) {               
moel@167
   338
        switch (name) {
moel@296
   339
          case "Alienware":
moel@296
   340
            return Manufacturer.Alienware;
moel@296
   341
          case "Apple Inc.":
moel@296
   342
            return Manufacturer.Apple;
moel@153
   343
          case "ASRock":
moel@195
   344
            return Manufacturer.ASRock;
moel@64
   345
          case "ASUSTeK Computer INC.":
moel@332
   346
          case "ASUSTeK COMPUTER INC.":
moel@195
   347
            return Manufacturer.ASUS;
moel@152
   348
          case "Dell Inc.":
moel@195
   349
            return Manufacturer.Dell;
moel@64
   350
          case "DFI":
moel@72
   351
          case "DFI Inc.":            
moel@195
   352
            return Manufacturer.DFI;
moel@177
   353
          case "ECS":
moel@195
   354
            return Manufacturer.ECS;
moel@64
   355
          case "EPoX COMPUTER CO., LTD":
moel@195
   356
            return Manufacturer.EPoX;
moel@132
   357
          case "EVGA":
moel@195
   358
            return  Manufacturer.EVGA;
moel@152
   359
          case "First International Computer, Inc.":
moel@195
   360
            return Manufacturer.FIC;
moel@296
   361
          case "FUJITSU":
moel@296
   362
          case "FUJITSU SIEMENS":
moel@296
   363
            return Manufacturer.Fujitsu;
moel@64
   364
          case "Gigabyte Technology Co., Ltd.":
moel@195
   365
            return  Manufacturer.Gigabyte;
moel@152
   366
          case "Hewlett-Packard":
moel@195
   367
            return  Manufacturer.HP;
moel@72
   368
          case "IBM":
moel@195
   369
            return  Manufacturer.IBM;
moel@296
   370
          case "Intel":
moel@296
   371
          case "Intel Corp.":
moel@296
   372
          case "Intel Corporation":
moel@296
   373
          case "INTEL Corporation":
moel@296
   374
            return Manufacturer.Intel;   
moel@296
   375
          case "Lenovo":
moel@296
   376
          case "LENOVO":
moel@296
   377
            return Manufacturer.Lenovo;
moel@296
   378
          case "Micro-Star International":
moel@64
   379
          case "MICRO-STAR INTERNATIONAL CO., LTD":
moel@72
   380
          case "MICRO-STAR INTERNATIONAL CO.,LTD":
moel@296
   381
          case "MSI":
moel@319
   382
            return Manufacturer.MSI;
moel@319
   383
          case "Shuttle":
moel@319
   384
            return Manufacturer.Shuttle;
moel@296
   385
          case "Supermicro":
moel@296
   386
            return Manufacturer.Supermicro;
moel@296
   387
          case "TOSHIBA":
moel@296
   388
            return Manufacturer.Toshiba;
moel@152
   389
          case "XFX":
moel@195
   390
            return  Manufacturer.XFX;
moel@152
   391
          case "To be filled by O.E.M.":
moel@195
   392
            return  Manufacturer.Unknown;
moel@64
   393
          default:
moel@195
   394
            return  Manufacturer.Unknown;
moel@126
   395
        }
moel@136
   396
      }
moel@195
   397
moel@195
   398
      private static Model GetModel(string name) {
moel@167
   399
        switch (name) {
moel@153
   400
          case "880GMH/USB3":
moel@195
   401
            return Model._880GMH_USB3;
moel@220
   402
          case "ASRock AOD790GX/128M":
moel@220
   403
            return Model.AOD790GX_128M;
moel@221
   404
          case "P55 Deluxe":
moel@221
   405
            return Model.P55_Deluxe;
moel@133
   406
          case "Crosshair III Formula":
moel@195
   407
            return Model.Crosshair_III_Formula;
moel@133
   408
          case "M2N-SLI DELUXE":
moel@195
   409
            return Model.M2N_SLI_DELUXE;
moel@144
   410
          case "M4A79XTD EVO":
moel@195
   411
            return Model.M4A79XTD_EVO;
moel@130
   412
          case "P5W DH Deluxe":
moel@195
   413
            return Model.P5W_DH_Deluxe;
moel@336
   414
          case "P6T":
moel@336
   415
            return Model.P6T;
moel@152
   416
          case "P6X58D-E":
moel@195
   417
            return Model.P6X58D_E;
moel@312
   418
          case "P8P67":
moel@312
   419
            return Model.P8P67;
moel@311
   420
          case "P8P67 EVO":
moel@311
   421
            return Model.P8P67_EVO;
moel@265
   422
          case "P8P67 PRO":
moel@265
   423
            return Model.P8P67_PRO;
moel@276
   424
          case "P8P67-M PRO":
moel@276
   425
            return Model.P8P67_M_PRO;
moel@332
   426
          case "P9X79":
moel@332
   427
            return Model.P9X79;
moel@174
   428
          case "Rampage Extreme":
moel@195
   429
            return Model.Rampage_Extreme;
moel@174
   430
          case "Rampage II GENE":
moel@195
   431
            return Model.Rampage_II_GENE;
moel@126
   432
          case "LP BI P45-T2RS Elite":
moel@195
   433
            return Model.LP_BI_P45_T2RS_Elite;
moel@126
   434
          case "LP DK P55-T3eH9":
moel@195
   435
            return Model.LP_DK_P55_T3eH9;
moel@177
   436
          case "A890GXM-A":
moel@195
   437
            return Model.A890GXM_A;
moel@132
   438
          case "X58 SLI Classified":
moel@195
   439
            return Model.X58_SLI_Classified;
moel@130
   440
          case "965P-S3":
moel@195
   441
            return Model._965P_S3;
moel@126
   442
          case "EP45-DS3R":
moel@195
   443
            return Model.EP45_DS3R;
moel@130
   444
          case "EP45-UD3R":
moel@195
   445
            return Model.EP45_UD3R;
moel@133
   446
          case "EX58-EXTREME":
moel@195
   447
            return Model.EX58_EXTREME;
moel@154
   448
          case "GA-MA770T-UD3":
moel@195
   449
            return Model.GA_MA770T_UD3;
moel@126
   450
          case "GA-MA785GMT-UD2H":
moel@195
   451
            return Model.GA_MA785GMT_UD2H;
moel@290
   452
          case "H67A-UD3H-B3":
moel@290
   453
            return Model.H67A_UD3H_B3;
moel@126
   454
          case "P35-DS3":
moel@195
   455
            return Model.P35_DS3;
moel@133
   456
          case "P35-DS3L":
moel@195
   457
            return Model.P35_DS3L;
moel@148
   458
          case "P55-UD4":
moel@195
   459
            return Model.P55_UD4;
moel@168
   460
          case "P55M-UD4":
moel@195
   461
            return Model.P55M_UD4;
moel@278
   462
          case "P67A-UD4-B3":
moel@278
   463
            return Model.P67A_UD4_B3;
moel@337
   464
          case "P8Z68-V PRO":
moel@337
   465
            return Model.P8Z68_V_PRO;
moel@130
   466
          case "X38-DS5":
moel@195
   467
            return Model.X38_DS5;
moel@138
   468
          case "X58A-UD3R":
moel@195
   469
            return Model.X58A_UD3R;
moel@305
   470
          case "Z68X-UD7-B3":
moel@305
   471
            return Model.Z68X_UD7_B3;
moel@320
   472
          case "FH67":
moel@320
   473
            return Model.FH67;
moel@296
   474
          case "Base Board Product Name":
moel@152
   475
          case "To be filled by O.E.M.":
moel@195
   476
            return Model.Unknown;
moel@126
   477
          default:
moel@195
   478
            return Model.Unknown;
moel@64
   479
        }
moel@64
   480
      }
moel@136
   481
      
moel@136
   482
      public BaseBoardInformation(string manufacturerName, string productName, 
moel@136
   483
        string version, string serialNumber) 
moel@136
   484
        : base(0x02, 0, null, null) 
moel@195
   485
      {
moel@195
   486
        this.manufacturerName = manufacturerName;
moel@195
   487
        this.manufacturer = GetManufacturer(manufacturerName);
moel@195
   488
        this.productName = productName;
moel@195
   489
        this.model = GetModel(productName);
moel@136
   490
        this.version = version;
moel@136
   491
        this.serialNumber = serialNumber;
moel@136
   492
      }
moel@136
   493
      
moel@136
   494
      public BaseBoardInformation(byte type, ushort handle, byte[] data,
moel@136
   495
        string[] strings)
moel@136
   496
        : base(type, handle, data, strings) {
moel@64
   497
moel@195
   498
        this.manufacturerName = GetString(0x04).Trim();
moel@195
   499
        this.manufacturer = GetManufacturer(this.manufacturerName);
moel@195
   500
        this.productName = GetString(0x05).Trim();
moel@195
   501
        this.model = GetModel(this.productName);
moel@136
   502
        this.version = GetString(0x06).Trim();
moel@136
   503
        this.serialNumber = GetString(0x07).Trim();               
moel@136
   504
      }
moel@136
   505
      
moel@64
   506
      public string ManufacturerName { get { return manufacturerName; } }
moel@64
   507
moel@64
   508
      public string ProductName { get { return productName; } }
moel@64
   509
moel@89
   510
      public string Version { get { return version; } }
moel@89
   511
moel@89
   512
      public string SerialNumber { get { return serialNumber; } }
moel@89
   513
moel@64
   514
      public Manufacturer Manufacturer { get { return manufacturer; } }
moel@89
   515
moel@126
   516
      public Model Model { get { return model; } }
moel@126
   517
moel@64
   518
    }
moel@64
   519
  }
moel@64
   520
}