Package oshi.hardware.common
Class AbstractSensors
java.lang.Object
oshi.hardware.common.AbstractSensors
- All Implemented Interfaces:
Sensors
Sensors from WMI or Open Hardware Monitor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
CPU Temperaturedouble
CPU Voltageint[]
Fan speedsprotected abstract double
protected abstract double
protected abstract int[]
toString()
-
Constructor Details
-
AbstractSensors
public AbstractSensors()
-
-
Method Details
-
getCpuTemperature
public double getCpuTemperature()Description copied from interface:Sensors
CPU Temperature- Specified by:
getCpuTemperature
in interfaceSensors
- Returns:
- CPU Temperature in degrees Celsius if available, 0 or
Double.NaN
otherwise.On Windows, if not running Open Hardware Monitor, requires elevated permissions and hardware BIOS that supports publishing to WMI. In this case, returns the temperature of the "Thermal Zone" which may be different than CPU temperature obtained from other sources. In addition, some motherboards may only refresh this value on certain events.
-
queryCpuTemperature
protected abstract double queryCpuTemperature() -
getFanSpeeds
public int[] getFanSpeeds()Description copied from interface:Sensors
Fan speeds- Specified by:
getFanSpeeds
in 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.
-
queryFanSpeeds
protected abstract int[] queryFanSpeeds() -
getCpuVoltage
public double getCpuVoltage()Description copied from interface:Sensors
CPU Voltage- Specified by:
getCpuVoltage
in interfaceSensors
- Returns:
- CPU Voltage in Volts if available, 0 otherwise.
-
queryCpuVoltage
protected abstract double queryCpuVoltage() -
toString
-