Package oshi.hardware.platform.windows
Class WindowsPowerSource
- java.lang.Object
-
- oshi.hardware.common.AbstractPowerSource
-
- oshi.hardware.platform.windows.WindowsPowerSource
-
- All Implemented Interfaces:
PowerSource
@ThreadSafe public final class WindowsPowerSource extends AbstractPowerSource
A Power Source
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface oshi.hardware.PowerSource
PowerSource.CapacityUnits
-
-
Field Summary
Fields Modifier and Type Field Description private static int
BATTERY_CAPACITY_RELATIVE
private static int
BATTERY_CHARGING
private static int
BATTERY_DISCHARGING
private static int
BATTERY_IS_SHORT_TERM
private static int
BATTERY_POWER_ON_LINE
private static int
BATTERY_SYSTEM_BATTERY
private static int
CHAR_WIDTH
private static com.sun.jna.platform.win32.Guid.GUID
GUID_DEVCLASS_BATTERY
private static int
IOCTL_BATTERY_QUERY_INFORMATION
private static int
IOCTL_BATTERY_QUERY_STATUS
private static int
IOCTL_BATTERY_QUERY_TAG
private static boolean
X64
-
Constructor Summary
Constructors Constructor Description WindowsPowerSource(java.lang.String psName, java.lang.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, java.lang.String psChemistry, java.time.LocalDate psManufactureDate, java.lang.String psManufacturer, java.lang.String psSerialNumber, double psTemperature)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
batteryQueryString(com.sun.jna.platform.win32.WinNT.HANDLE hBattery, int tag, int infoLevel)
private static WindowsPowerSource
getPowerSource(java.lang.String name)
static java.util.List<PowerSource>
getPowerSources()
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 Detail
-
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:
- Constant Field Values
-
BATTERY_IS_SHORT_TERM
private static final int BATTERY_IS_SHORT_TERM
- See Also:
- Constant Field Values
-
BATTERY_POWER_ON_LINE
private static final int BATTERY_POWER_ON_LINE
- See Also:
- Constant Field Values
-
BATTERY_DISCHARGING
private static final int BATTERY_DISCHARGING
- See Also:
- Constant Field Values
-
BATTERY_CHARGING
private static final int BATTERY_CHARGING
- See Also:
- Constant Field Values
-
BATTERY_CAPACITY_RELATIVE
private static final int BATTERY_CAPACITY_RELATIVE
- See Also:
- Constant Field Values
-
IOCTL_BATTERY_QUERY_TAG
private static final int IOCTL_BATTERY_QUERY_TAG
- See Also:
- Constant Field Values
-
IOCTL_BATTERY_QUERY_STATUS
private static final int IOCTL_BATTERY_QUERY_STATUS
- See Also:
- Constant Field Values
-
IOCTL_BATTERY_QUERY_INFORMATION
private static final int IOCTL_BATTERY_QUERY_INFORMATION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WindowsPowerSource
public WindowsPowerSource(java.lang.String psName, java.lang.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, java.lang.String psChemistry, java.time.LocalDate psManufactureDate, java.lang.String psManufacturer, java.lang.String psSerialNumber, double psTemperature)
-
-
Method Detail
-
getPowerSources
public static java.util.List<PowerSource> getPowerSources()
Gets Battery Information.- Returns:
- A list of PowerSource objects representing batteries, etc.
-
getPowerSource
private static WindowsPowerSource getPowerSource(java.lang.String name)
-
batteryQueryString
private static java.lang.String batteryQueryString(com.sun.jna.platform.win32.WinNT.HANDLE hBattery, int tag, int infoLevel)
-
-