Class AbstractSensors

java.lang.Object
oshi.hardware.common.AbstractSensors
All Implemented Interfaces:
Sensors

@ThreadSafe public abstract class AbstractSensors extends Object implements Sensors
Sensors from WMI or Open Hardware Monitor
  • Constructor Details

    • AbstractSensors

      public AbstractSensors()
  • Method Details

    • getCpuTemperature

      public double getCpuTemperature()
      Description copied from interface: Sensors
      CPU Temperature
      Specified by:
      getCpuTemperature in interface Sensors
      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 interface Sensors
      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 interface Sensors
      Returns:
      CPU Voltage in Volts if available, 0 otherwise.
    • queryCpuVoltage

      protected abstract double queryCpuVoltage()
    • toString

      public String toString()
      Overrides:
      toString in class Object