EMNSystemInfo.HardwareAPI 0.3.0

dotnet add package EMNSystemInfo.HardwareAPI --version 0.3.0
NuGet\Install-Package EMNSystemInfo.HardwareAPI -Version 0.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EMNSystemInfo.HardwareAPI" Version="0.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EMNSystemInfo.HardwareAPI --version 0.3.0
#r "nuget: EMNSystemInfo.HardwareAPI, 0.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EMNSystemInfo.HardwareAPI as a Cake Addin
#addin nuget:?package=EMNSystemInfo.HardwareAPI&version=0.3.0

// Install EMNSystemInfo.HardwareAPI as a Cake Tool
#tool nuget:?package=EMNSystemInfo.HardwareAPI&version=0.3.0

EMNSystemInfo.HardwareAPI

IMPORTANT NOTE:

The copyright notice of this version of the library IS NOT VALID.
VALID COPYRIGHT NOTICE:
Copyright © LibreHardwareMonitor and Contributors.
Partial Copyright © Michael Möller <mmoeller@openhardwaremonitor.org> and Contributors.

GitHub license Nuget

EMNSystemInfo.HardwareAPI is a hardware library for Windows based on Libre Hardware Monitor, designed for the .NET platform. It provides a base model to access hardware information, in which you can build other models like "tree view", which Libre Hardware Monitor offers. The model I'm proposing here consists on lists of classes that represent a specific hardware. These classes contain the properties of the hardware they are representing and a method to update them.

Hardware support

  • Laptop batteries

  • Processors:

    • Intel
    • AMD
  • Video cards:

    • AMD
    • NVIDIA
    • Intel integrated graphics
  • LPC chips (the "x"s represent any number or character the chip model could contain):

    • ASUS ATK0110 (Super I/O)
    • Fintek F718xx (Super I/O)
    • iTE IT8xx (Super I/O)
    • Nuvoton NCT6xx (Super I/O)
    • Winbond W836xx (Super I/O)
    • Embedded Controllers
  • Physical storage:

    • All types. Though only its generic information can be accessed. To access more specific info, these drives are supported:
    • Any drive with S.M.A.R.T. access
    • HDDs
    • NVMe drives
    • Indilinx SSDs
    • Intel SSDs
    • Micron SSDs
    • Plextor SSDs
    • Samsung SSDs
    • Sandforce SSDs
  • Coolers:

    • AeroCool P7-H1
    • AquaComputer (Aquastream XT, D5Next, MPS) (water cooling)
    • Heatmaster (water cooling)
    • NZXT Kraken X3 (water cooling)
    • TBalancer (water cooling)

Where can I download it?

You can download the latest version from NuGet here. Alternatively, you can download the NuGet package from Releases page.

How does it work?

The main component is the LibrarySettings class, whose task is provide library configuration options, like the kernel driver name, and provide the Initialize & Close methods that prepare the library to use their components and free resources when they're no longer needed, respectively.

This library has static classes that represent a hardware group, some of them have requirements about library initialization and execution with admin privileges.

This table shows the hardware group classes and their requirements:

Class name Requires library initialization? Requires admin privileges?
Batteries No No
Processors Yes No*
GPUs No Yes
LPCChips Yes Yes
StorageDrives No No**
Coolers No Yes (probably)

**: But, if the library is not executing with admin privileges, only generic storage info can be accessed, regardless of the drive type.

*: It's the same case as StorageDrives. No admin privileges, only generic CPU info can be accessed, regardless of the type.

These hardware group classes have a property named "List" that contains classes that represent each installed hardware element, and methods to load and delete them from the mentioned property.

Finally, these classes that represent a hardware element contain properties about its information and sensor values. Some of these classes instances provide more detailed-and-specific information for a hardware. To access it, you have to check the hardware type the instance is representing, with the "Type" property. Then, you have to convert that instance into the one denoted by the "Type" property.

Why this library installs a kernel driver?

Because the majority of hardware information, like CPU info or LPC chips info, is obtained through the execution of instructions not available for a normal app. Also, it communicates with hardware through system buses. Those functions are only available for kernel drivers, that's the reason it is necessary to install one. All programs that show detailed info about hardware and sensors install one too. In the case of this library, you decide when to install or uninstall the driver, with the methods Initialize & Close from LibrarySettings class.

Example for .NET 6:

Get info about installed CPUs

using EMNSystemInfo.HardwareAPI;
using EMNSystemInfo.HardwareAPI.CPU;

LibrarySettings.Initialize(); // It's necessary to initialize the library to get generic CPU info

Processors.Load(); // Load CPUs into the List property
foreach (Processor p in Processors.List)
{
    p.Update();

    Console.WriteLine("Processor N.º {0}", p.Index + 1);
    Console.WriteLine(" · Brand String: {0}", p.BrandString);
    Console.WriteLine(" · Name: {0}", p.Name);
    Console.WriteLine(" · Manufacturer: {0}", p.Vendor);
    Console.WriteLine(" · Family: {0}", p.Family);
    Console.WriteLine(" · Model: {0}", p.Model);
    Console.WriteLine(" · Stepping: {0}", p.Stepping);
    Console.WriteLine(" · Core Count: {0}", p.CoreCount);
    Console.WriteLine(" · Thread Count: {0}", p.ThreadCount);
    Console.WriteLine(" · Total Load: {0:F2} %", p.TotalLoad);
}
Processors.Dispose();

LibrarySettings.Close();

Check out the EMNSystemInfo.HardwareAPITest folder for a complete example with all the hardware supported by this library.

License

This library is licensed under the Mozilla Public License (MPL) 2.0, you can use it on private and commercial projects, but you must include a copy of this license in your project.

Name meaning and why I've made this library?

The name comes from a personal app about system info I'm developing as a hobby. The letters EMN are my initials.

I've made this library because the way of getting hardware info Libre Hardware Monitor offers didn't convince me. I wanted to access hardware info directly with one or more properties instead of searching it in a sensor list. That's why I've decided to fork Libre Hardware Monitor, replacing the model it offered with the one I'm proposing here.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.0 342 12/8/2022
0.2.14.5 392 6/15/2022
0.2.12.4 386 6/4/2022
0.2.11.3 399 5/21/2022
0.2.10.2 397 5/8/2022
0.2.9.1 383 5/3/2022
0.1.56.20 404 5/2/2022
0.1.55.19 396 5/2/2022
0.1.54.18 407 5/1/2022
0.1.52.17 426 4/23/2022
0.1.50.16 435 4/21/2022
0.1.48.14 431 4/19/2022
0.1.46.13 440 4/13/2022
0.1.45.11 454 4/11/2022

· Drop support for .NET 5.0
· Add support for TBalancer coolers (from LibreHardwareMonitor)
· Fix possible InvalidOperationException when getting S.M.A.R.T. sensors.
  As a result, SMARTSensor.Threshold is a nullable property now.
· Port PR #720 from LibreHardwareMonitor (Sync EC implementation to the Linux driver)
  - Added new ECSensorType: VoltageCPU
· Port PR #768 from LibreHardwareMonitor (Add Aqua Computer Octo support)
  - Added new class: AquaComputerOcto
· Add support for .NET 7

Merged PRs from LibreHardwareMonitor:
· #711 (Added X570 Aorus Ultra to supported list)
· #704 (Add motherboard: Gigabyte Z690 Gaming X DDR4 (#703))
· #700 (Add EC sensors and fan names for ASUS Z170-A)
  - Added new ECSensorType: FanWaterPump
· #722 (Add a note with a plea to share updates to the EC data with the Linux community)
· #726 (EC: add sensors for ProArt X570-CREATOR WIFI)
· #740 (Update EmbeddedController.cs)
· #752 (Add support for ROG MAXIMUS Z690 EXTREME GLACIAL)
  - Added new ECSensorType: TempWaterBlockIn
· #750 (RyzenSMU: add some more metrics for Zen3)
· #754 (Exclude 980 Pro from samsung NVMe protocol)
· #758 (Cleaned up mutex security code.)
· #767 (added specific support for X570-i in superio and added vrm/chipset temperature sensor in Asus EC.)
· #777 (ROG Zenith II Extreme support)
· #779 (Added Alder Lake-H model ID)
· #815 (Add RaptorLake and one more Alder Lake)
  - Added new IntelMicroarchitecture: RaptorLake