Hardware
The information refer to the available hardware of the device
Available information
On desktop target the available hardware information are the below:
| Category | Property | Description | Source |
|---|---|---|---|
| Computer System | computerSystem |
The details of the computer system | Hardware.computerSystem |
| CPU | centralProcessor |
The details of the system's central processor (CPU) | Hardware.centralProcessor |
| Memory | globalMemory |
The details about the system's global memory | Hardware.globalMemory |
| Power Sources | powerSources |
A list of power sources available to the system | Hardware.powerSources |
| Disk Storage | diskStores |
A list of disk storage devices | Hardware.diskStores |
| Logical Volumes | logicalVolumeGroups |
A list of logical volume groups configured on the system | Hardware.logicalVolumeGroups |
| Network Interfaces | networkIFs |
A list of network interfaces on the system | Hardware.networkIFs |
| Displays | displays |
A list of display devices connected to the system | Hardware.displays |
| Sensors | sensors |
The details of system sensors | Hardware.sensors |
| Sound Cards | soundCards |
A list of sound cards available on the system | Hardware.soundCards |
| Graphics Cards | graphicsCards |
A list of graphics cards available on the system | Hardware.graphicsCards |
API source
The information are retrievable using the DesktopInfo.Hardware API:
Hardware API
Retrieve a Hardware instance from desktopInfo instance
Properties
The below properties are miscellaneous readable properties provided by the hardware instance
powerSources
List of power sources available in the system
diskStores
List of storage devices available in the system
logicalVolumeGroups
List of logical volume groups on the system
val logicalVolumeGroups: List<LogicalVolumeGroup> = hardware.logicalVolumeGroups
println(logicalVolumeGroups)
networkIFs
List of network interfaces available on the system
displays
List of displays connected to the system
soundCards
List of sound cards available on the system
graphicsCards
List of graphic cards available on the system
Methods
The below methods are provided by hardware instance, and are useful to interact with the device to retrieve any available information
getNetworkIfs
Returns the list of network interfaces on the system
Parameters
- includeLocalInterfaces
:Boolean- Whether to include local interfaces (such as loopback)
val networkIfs: List<NetworkIF> = hardware.getNetworkIfs(
includeLocalInterfaces = // true or false
)
println(networkIfs)
getUsbDevices
Retrieves the USB devices connected to the system, with the option to represent them as a device tree
Parameters
- tree
:Boolean- Whether to return a tree structure of connected devices
Interfaces
- UsbDevice - Represents a USB device