Package oshi.hardware.platform.linux
Class LinuxSensors
java.lang.Object
oshi.hardware.common.AbstractSensors
oshi.hardware.platform.linux.LinuxSensors
- All Implemented Interfaces:
Sensors
Sensors from WMI or Open Hardware Monitor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
getSensorFilesFromPath
(String sensorPath, String sensor, FileFilter sensorFileFilter) Find all sensor files in a specific path and adds them to the hwmonMapprivate void
private void
double
private static double
Retrieves temperature from Raspberry Pidouble
private static double
Retrieves voltage from Raspberry Piint[]
Methods inherited from class oshi.hardware.common.AbstractSensors
getCpuTemperature, getCpuVoltage, getFanSpeeds, toString
-
Field Details
-
TEMP
- See Also:
-
FAN
- See Also:
-
VOLTAGE
- See Also:
-
SENSORS
-
HWMON
- See Also:
-
HWMON_PATH
-
THERMAL_ZONE
- See Also:
-
THERMAL_ZONE_PATH
-
IS_PI
private static final boolean IS_PI -
sensorsMap
-
-
Constructor Details
-
LinuxSensors
LinuxSensors()Constructor for LinuxSensors.
-
-
Method Details
-
populateSensorsMapFromHwmon
private void populateSensorsMapFromHwmon() -
populateSensorsMapFromThermalZone
private void populateSensorsMapFromThermalZone() -
getSensorFilesFromPath
Find all sensor files in a specific path and adds them to the hwmonMap- Parameters:
sensorPath
- A string containing the sensor pathsensor
- A string containing the sensorsensorFileFilter
- A FileFilter for detecting valid sensor files
-
queryCpuTemperature
public double queryCpuTemperature()- Specified by:
queryCpuTemperature
in classAbstractSensors
-
queryCpuTemperatureFromVcGenCmd
private static double queryCpuTemperatureFromVcGenCmd()Retrieves temperature from Raspberry Pi- Returns:
- The temperature on a Pi, 0 otherwise
-
queryFanSpeeds
public int[] queryFanSpeeds()- Specified by:
queryFanSpeeds
in classAbstractSensors
-
queryCpuVoltage
public double queryCpuVoltage()- Specified by:
queryCpuVoltage
in classAbstractSensors
-
queryCpuVoltageFromVcGenCmd
private static double queryCpuVoltageFromVcGenCmd()Retrieves voltage from Raspberry Pi- Returns:
- The temperature on a Pi, 0 otherwise
-