Skip to content

Commit

Permalink
Updated to v3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
iAJTin committed Aug 25, 2020
1 parent 39761cc commit f765e8f
Show file tree
Hide file tree
Showing 22 changed files with 1,045 additions and 37 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.1.4] -
## [1.1.4] - 2020-08-25

### Added

Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,17 @@ For more information, please see [https://www.dmtf.org/standards/smbios](https:/

# Usage

Call **DMI.Instance.Structures** for getting all SMBIOS structures availables.
#### Before

Call **DMI.Instance.Structures** for getting all SMBIOS structures availables.

#### Now

The **DMI.Instance** property now is mark as obsolete use **DMI.CreateInstance()** method instead
If you want to connect to a remote machine fill in an instance of the DmiConnectOptions object and use it
as the argument of the **DMI method.CreateInstance(optionsInstance)**.

For more info, please see [CHANGELOG] file.

## Examples

Expand Down Expand Up @@ -217,3 +227,5 @@ Call **DMI.Instance.Structures** for getting all SMBIOS structures availables.
If you have found **iSMBIOS** useful at work or in a personal project, I would love to hear about it. If you have decided not to use **iSMBIOS**, please send me and email stating why this is so. I will use this feedback to improve **iSMBIOS** in future releases.

My email address is [email protected]

[CHANGELOG]: https://github.com/iAJTin/iSMBIOS/blob/master/CHANGELOG.md
18 changes: 14 additions & 4 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Library versions for current iSMBIOS version (1.1.3)
•———————————————————————————————————————————————————————————————————————————————————————————•
| Library Version Description |
•———————————————————————————————————————————————————————————————————————————————————————————•
|iTin.Core 1.0.1.0 Common calls |
|iTin.Core 1.0.2.0 Common calls |
•———————————————————————————————————————————————————————————————————————————————————————————•
|iTin.Core.Interop 1.0.0.0 Interop calls |
•———————————————————————————————————————————————————————————————————————————————————————————•
|iTin.Core.Hardware 1.0.1.0 Hardware Interop Calls |
•———————————————————————————————————————————————————————————————————————————————————————————•
|iTin.Core.Hardware.Specification.Dmi 3.3.0.1 DMI Specification Implementation |
|iTin.Core.Hardware.Specification.Dmi 3.3.0.3 DMI Specification Implementation |
•———————————————————————————————————————————————————————————————————————————————————————————•
|iTin.Core.Hardware.Specification.Smbios 3.3.0.2 SMBIOS Specification Implementation |
|iTin.Core.Hardware.Specification.Smbios 3.3.0.3 SMBIOS Specification Implementation |
•———————————————————————————————————————————————————————————————————————————————————————————•
|iTin.Core.Hardware.Specification.Tpm 1.0.0.0 TPM Specification Implementation |
•———————————————————————————————————————————————————————————————————————————————————————————•
Expand All @@ -37,7 +37,17 @@ For more information, please see https://www.nuget.org/packages/iSMBIOS/
Usage
=====

Call DMI.Instance.Structures for getting all SMBIOS structures availables.
- Before

Call DMI.Instance.Structures for getting all SMBIOS structures availables.

- Now

The DMI.Instance property now is mark as obsolete use DMI.CreateInstance() method instead
If you want to connect to a remote machine fill in an instance of the DmiConnectOptions object and use it
as the argument of the DMI method.CreateInstance(optionsInstance).

For more info, please see CHANGELOG file (https://github.com/iAJTin/iSMBIOS/blob/master/CHANGELOG.md).

Examples
--------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ public static class BaseBoard
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref=byte"/></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey NumberOfContainedObjectHandles => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.NumberOfContainedObjectHandles);
Expand Down Expand Up @@ -3524,6 +3524,197 @@ public static class SystemSlots
#endregion

#endregion

#region version 3.2

#region [public] {static} (IPropertyKey) PeerDevices: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The PCI Express Generation (e.g., PCI Express Generation 6).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.PeerDevices"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="DmiPeerDevicesCollection"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey PeerDevices => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.PeerDevices);
#endregion

#endregion

#region version 3.4

#region [public] {static} (IPropertyKey) SlotInformation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The PCI Express Generation (e.g., PCI Express Generation 6).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotInformation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.4</para>
/// </para>
/// </summary>
public static IPropertyKey SlotInformation => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotInformation);
#endregion

#region [public] {static} (IPropertyKey) SlotPhysicalWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates the physical width of the slot whereas <see cref="SystemSlots.SlotDataBusWidth"/> property indicates the electrical width of the slot.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotPhysicalWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.4</para>
/// </para>
/// </summary>
public static IPropertyKey SlotPhysicalWidth => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotPhysicalWidth);
#endregion

#region [public] {static} (IPropertyKey) SlotPitch: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates the pitch of the slot in millimeters. The pitch is defined by each slot/card specification, but typically describes add-in card to add-in card pitch.</para>
/// <para>A value of 0 implies that the slot pitch is not given or is unknown.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotPitch"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mm"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.4</para>
/// </para>
/// </summary>
public static IPropertyKey SlotPitch => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotPitch, PropertyUnit.mm);
#endregion

#endregion


#region nested classes

#region [public] {static} (class) Peers: Contains the key definition for the 'Peers' section
/// <summary>
/// Contains the key definition for the <b>Peers</b> section.
/// </summary>
public static class Peers
{
#region [public] {static} (IPropertyKey) SegmentGroupNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Segment Group Number is defined in the PCI Firmware Specification. The value is 0 for a single-segment topology.</para>
/// <para>For PCI Express slots, Bus Number and Device/Function Number refer to the endpoint in the slot, not the upstream switch.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SegmentGroupNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey SegmentGroupNumber => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SegmentGroupNumber);
#endregion

#region [public] {static} (IPropertyKey) BusDeviceFunction: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Bus device function (Peer).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.BusDeviceFunctionPeer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey BusDeviceFunction => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.BusDeviceFunctionPeer);
#endregion

#region [public] {static} (IPropertyKey) DataBusWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates electrical bus width of peer Segment/Bus/Device/Function.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.DataBusWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey DataBusWidth => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.DataBusWidth);
#endregion
}
#endregion

#endregion
}
#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,46 @@ internal enum DmiType009Property
[PropertyName("Bus Device Function")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
BusDeviceFunction
BusDeviceFunction,
#endregion

#region version 3.2
[PropertyName("Peers Devices")]
[PropertyDescription("Peers Devices")]
[PropertyType(typeof(PeerDevicesCollection))]
PeerDevices,

[PropertyName("Segment Group Number")]
[PropertyDescription("Defined in the PCI Firmware Specification")]
[PropertyType(typeof(ushort))]
SegmentGroupNumber,

[PropertyName("Bus Device Function")]
[PropertyDescription("Bus Device Function (Peer)")]
[PropertyType(typeof(string))]
BusDeviceFunctionPeer,

[PropertyName("Data Bus Width")]
[PropertyDescription("Data Bus Width (Peer)")]
[PropertyType(typeof(byte))]
DataBusWidth,
#endregion

#region version 3.4
[PropertyName("Slot Information")]
[PropertyDescription("Slot Information")]
[PropertyType(typeof(string))]
SlotInformation,

[PropertyName("Slot Physical Width")]
[PropertyDescription("Slot Physical Width")]
[PropertyType(typeof(string))]
SlotPhysicalWidth,

[PropertyName("Slot Pitch")]
[PropertyDescription("Slot Pitch")]
[PropertyType(typeof(int))]
SlotPitch,
#endregion
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace iTin.Core.Hardware.Specification.Dmi
using Smbios;
using Smbios.Property;

/// <inheritdoc/>
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Slot Information (Type 9) structure.
/// For more information, please see <see cref="SmbiosType009"/>.
Expand Down Expand Up @@ -104,6 +103,40 @@ protected override void PopulateProperties(DmiClassPropertiesTable properties)
}
}
#endregion

#region 3.2
if (SmbiosStructure.StructureInfo.StructureVersion >= SmbiosStructureVersion.v32)
{
object peerDevices = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.PeerDevices);
if (peerDevices != null)
{
properties.Add(DmiProperty.SystemSlots.PeerDevices, new DmiPeerDevicesCollection((PeerDevicesCollection)peerDevices));
}
}
#endregion

#region 3.4
if (SmbiosStructure.StructureInfo.StructureVersion >= SmbiosStructureVersion.v34)
{
object slotInformation = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SlotInformation);
if (slotInformation != null)
{
properties.Add(DmiProperty.SystemSlots.SlotInformation, slotInformation);
}

object slotPhysicalWidth = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SlotPhysicalWidth);
if (slotPhysicalWidth != null)
{
properties.Add(DmiProperty.SystemSlots.SlotPhysicalWidth, slotPhysicalWidth);
}

object slotPitch = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SlotPitch);
if (slotPitch != null)
{
properties.Add(DmiProperty.SystemSlots.SlotPitch, (ushort)((ushort)slotPitch / 100));
}
}
#endregion
}
#endregion

Expand Down
Loading

0 comments on commit f765e8f

Please sign in to comment.