Class AbstractSensors
java.lang.Object
oshi.hardware.common.AbstractSensors
- All Implemented Interfaces:
Sensors
Sensors from WMI or Open Hardware Monitor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleCPU TemperaturedoubleCPU Voltageint[]Fan speedsprotected abstract doubleprotected abstract doubleprotected abstract int[]toString()
-
Constructor Details
-
AbstractSensors
public AbstractSensors()
-
-
Method Details
-
getCpuTemperature
public double getCpuTemperature()Description copied from interface:SensorsCPU Temperature- Specified by:
getCpuTemperaturein interfaceSensors- Returns:
- CPU Temperature in degrees Celsius if available, 0 or
Double.NaNotherwise. Callers should check for both zero and NaN to detect unavailable data.On Windows, requires the optional jLibreHardwareMonitor dependency for reliable values. Without it, results may be zero or unchanging depending on the motherboard manufacturer.
On Linux, values are read from hwmon sensors or thermal zones. The sensor names and priority can be configured via
oshi.os.linux.sensors.hwmon.namesandoshi.os.linux.sensors.cpuTemperature.typesin the configuration.
-
queryCpuTemperature
protected abstract double queryCpuTemperature() -
getFanSpeeds
public int[] getFanSpeeds()Description copied from interface:SensorsFan speeds- Specified by:
getFanSpeedsin interfaceSensors- Returns:
- Speed in rpm for all fans. May return empty array if no fans detected or 0 fan speed if unable to measure
fan speed.
On Windows, requires the optional jLibreHardwareMonitor dependency for reliable values.
-
queryFanSpeeds
protected abstract int[] queryFanSpeeds() -
getCpuVoltage
public double getCpuVoltage()Description copied from interface:SensorsCPU Voltage- Specified by:
getCpuVoltagein interfaceSensors- Returns:
- CPU Voltage in Volts if available, 0 otherwise.
On Windows, requires the optional jLibreHardwareMonitor dependency for reliable values.
-
queryCpuVoltage
protected abstract double queryCpuVoltage() -
toString
-