Package oshi.hardware.platform.windows
Class WindowsPowerSource
java.lang.Object
oshi.hardware.common.AbstractPowerSource
oshi.hardware.platform.windows.WindowsPowerSource
- All Implemented Interfaces:
PowerSource
A Power Source
-
Nested Class Summary
Nested classes/interfaces inherited from interface oshi.hardware.PowerSource
PowerSource.CapacityUnits
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final com.sun.jna.platform.win32.Guid.GUID
private static final int
private static final int
private static final int
private static final boolean
-
Constructor Summary
ConstructorsConstructorDescriptionWindowsPowerSource
(String psName, String psDeviceName, double psRemainingCapacityPercent, double psTimeRemainingEstimated, double psTimeRemainingInstant, double psPowerUsageRate, double psVoltage, double psAmperage, boolean psPowerOnLine, boolean psCharging, boolean psDischarging, PowerSource.CapacityUnits psCapacityUnits, int psCurrentCapacity, int psMaxCapacity, int psDesignCapacity, int psCycleCount, String psChemistry, LocalDate psManufactureDate, String psManufacturer, String psSerialNumber, double psTemperature) -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
batteryQueryString
(com.sun.jna.platform.win32.WinNT.HANDLE hBattery, int tag, int infoLevel) private static WindowsPowerSource
getPowerSource
(String name) static List
<PowerSource> Gets Battery Information.Methods inherited from class oshi.hardware.common.AbstractPowerSource
getAmperage, getCapacityUnits, getChemistry, getCurrentCapacity, getCycleCount, getDesignCapacity, getDeviceName, getManufactureDate, getManufacturer, getMaxCapacity, getName, getPowerUsageRate, getRemainingCapacityPercent, getSerialNumber, getTemperature, getTimeRemainingEstimated, getTimeRemainingInstant, getVoltage, isCharging, isDischarging, isPowerOnLine, toString, updateAttributes
-
Field Details
-
GUID_DEVCLASS_BATTERY
private static final com.sun.jna.platform.win32.Guid.GUID GUID_DEVCLASS_BATTERY -
CHAR_WIDTH
private static final int CHAR_WIDTH -
X64
private static final boolean X64 -
BATTERY_SYSTEM_BATTERY
private static final int BATTERY_SYSTEM_BATTERY- See Also:
-
BATTERY_IS_SHORT_TERM
private static final int BATTERY_IS_SHORT_TERM- See Also:
-
BATTERY_POWER_ON_LINE
private static final int BATTERY_POWER_ON_LINE- See Also:
-
BATTERY_DISCHARGING
private static final int BATTERY_DISCHARGING- See Also:
-
BATTERY_CHARGING
private static final int BATTERY_CHARGING- See Also:
-
BATTERY_CAPACITY_RELATIVE
private static final int BATTERY_CAPACITY_RELATIVE- See Also:
-
IOCTL_BATTERY_QUERY_TAG
private static final int IOCTL_BATTERY_QUERY_TAG- See Also:
-
IOCTL_BATTERY_QUERY_STATUS
private static final int IOCTL_BATTERY_QUERY_STATUS- See Also:
-
IOCTL_BATTERY_QUERY_INFORMATION
private static final int IOCTL_BATTERY_QUERY_INFORMATION- See Also:
-
-
Constructor Details
-
WindowsPowerSource
public WindowsPowerSource(String psName, String psDeviceName, double psRemainingCapacityPercent, double psTimeRemainingEstimated, double psTimeRemainingInstant, double psPowerUsageRate, double psVoltage, double psAmperage, boolean psPowerOnLine, boolean psCharging, boolean psDischarging, PowerSource.CapacityUnits psCapacityUnits, int psCurrentCapacity, int psMaxCapacity, int psDesignCapacity, int psCycleCount, String psChemistry, LocalDate psManufactureDate, String psManufacturer, String psSerialNumber, double psTemperature)
-
-
Method Details
-
getPowerSources
Gets Battery Information.- Returns:
- A list of PowerSource objects representing batteries, etc.
-
getPowerSource
-
batteryQueryString
private static String batteryQueryString(com.sun.jna.platform.win32.WinNT.HANDLE hBattery, int tag, int infoLevel)
-