Class WindowsPowerSource
java.lang.Object
oshi.hardware.common.AbstractPowerSource
oshi.hardware.common.platform.windows.WindowsPowerSource
- All Implemented Interfaces:
PowerSource
- Direct Known Subclasses:
WindowsPowerSourceJNA
A Power Source
-
Nested Class Summary
Nested classes/interfaces inherited from interface PowerSource
PowerSource.CapacityUnitsModifier and TypeInterfaceDescriptionstatic enumUnits of Battery Capacity -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intBattery capability flag: capacity is relative (percent).protected static final intBattery power state flag: charging.protected static final intQuery information level: device name.protected static final intBattery power state flag: discharging.protected static final intQuery information level: estimated time remaining.protected static final intQuery information level: battery information.protected static final intBattery capability flag: short-term (UPS).protected static final intQuery information level: manufacture date.protected static final intQuery information level: manufacturer name.protected static final intBattery power state flag: AC power online.protected static final intQuery information level: serial number.protected static final intBattery capability flag: system battery.protected static final intQuery information level: temperature.protected static final intIOCTL code to query battery information.protected static final intIOCTL code to query battery status.protected static final intIOCTL code to query battery tag. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWindowsPowerSource(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) Constructor. -
Method Summary
Methods inherited from class AbstractPowerSource
getAmperage, getCapacityUnits, getChemistry, getCurrentCapacity, getCycleCount, getDesignCapacity, getDeviceName, getManufactureDate, getManufacturer, getMaxCapacity, getName, getPowerUsageRate, getRemainingCapacityPercent, getSerialNumber, getTemperature, getTimeRemainingEstimated, getTimeRemainingInstant, getVoltage, isCharging, isDischarging, isPowerOnLine, queryPowerSources, toString, updateAttributesModifier and TypeMethodDescriptiondoubleAmperage of the battery, in milliAmperes (mA).Reports =the units ofPowerSource.getCurrentCapacity(),PowerSource.getMaxCapacity(), andPowerSource.getDesignCapacity()The battery chemistry (e.g., Lithium Ion).intThe current (remaining) capacity of the battery.intThe cycle count of the battery, if known.intThe design (original) capacity of the battery.Name of the power source at the device level.The battery's date of manufacture.The name of the battery's manufacturer.intThe maximum capacity of the battery.getName()Name of the power source at the Operating System level.doublePower Usage Rate of the battery, in milliWatts (mW).doubleEstimated remaining capacity as a fraction of max capacity.The battery's serial number.doubleThe battery's temperature, in degrees Celsius.doubleEstimated time remaining on the power source, in seconds, as reported by the operating system.doubleEstimated time remaining on the power source, in seconds, as reported by the battery.doubleVoltage of the battery, in Volts.booleanReports whether the battery is charging.booleanReports whether the battery is discharging.booleanReports whether the device is plugged in to an external power source.protected abstract List<PowerSource> Returns a fresh list of power sources for this platform, used byAbstractPowerSource.updateAttributes().toString()booleanUpdates statistics on this battery.
-
Field Details
-
IOCTL_BATTERY_QUERY_TAG
protected static final int IOCTL_BATTERY_QUERY_TAGIOCTL code to query battery tag.- See Also:
-
IOCTL_BATTERY_QUERY_INFORMATION
protected static final int IOCTL_BATTERY_QUERY_INFORMATIONIOCTL code to query battery information.- See Also:
-
IOCTL_BATTERY_QUERY_STATUS
protected static final int IOCTL_BATTERY_QUERY_STATUSIOCTL code to query battery status.- See Also:
-
BATTERY_SYSTEM_BATTERY
protected static final int BATTERY_SYSTEM_BATTERYBattery capability flag: system battery.- See Also:
-
BATTERY_IS_SHORT_TERM
protected static final int BATTERY_IS_SHORT_TERMBattery capability flag: short-term (UPS).- See Also:
-
BATTERY_CAPACITY_RELATIVE
protected static final int BATTERY_CAPACITY_RELATIVEBattery capability flag: capacity is relative (percent).- See Also:
-
BATTERY_POWER_ON_LINE
protected static final int BATTERY_POWER_ON_LINEBattery power state flag: AC power online.- See Also:
-
BATTERY_DISCHARGING
protected static final int BATTERY_DISCHARGINGBattery power state flag: discharging.- See Also:
-
BATTERY_CHARGING
protected static final int BATTERY_CHARGINGBattery power state flag: charging.- See Also:
-
BATTERY_INFORMATION_LEVEL
protected static final int BATTERY_INFORMATION_LEVELQuery information level: battery information.- See Also:
-
BATTERY_TEMPERATURE_LEVEL
protected static final int BATTERY_TEMPERATURE_LEVELQuery information level: temperature.- See Also:
-
BATTERY_ESTIMATED_TIME_LEVEL
protected static final int BATTERY_ESTIMATED_TIME_LEVELQuery information level: estimated time remaining.- See Also:
-
BATTERY_DEVICE_NAME_LEVEL
protected static final int BATTERY_DEVICE_NAME_LEVELQuery information level: device name.- See Also:
-
BATTERY_MANUFACTURE_DATE_LEVEL
protected static final int BATTERY_MANUFACTURE_DATE_LEVELQuery information level: manufacture date.- See Also:
-
BATTERY_MANUFACTURE_NAME_LEVEL
protected static final int BATTERY_MANUFACTURE_NAME_LEVELQuery information level: manufacturer name.- See Also:
-
BATTERY_SERIAL_NUMBER_LEVEL
protected static final int BATTERY_SERIAL_NUMBER_LEVELQuery information level: serial number.- See Also:
-
-
Constructor Details
-
WindowsPowerSource
protected 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) Constructor.- Parameters:
psName- the psNamepsDeviceName- the psDeviceNamepsRemainingCapacityPercent- the psRemainingCapacityPercentpsTimeRemainingEstimated- the psTimeRemainingEstimatedpsTimeRemainingInstant- the psTimeRemainingInstantpsPowerUsageRate- the psPowerUsageRatepsVoltage- the psVoltagepsAmperage- the psAmperagepsPowerOnLine- the psPowerOnLinepsCharging- the psChargingpsDischarging- the psDischargingpsCapacityUnits- the psCapacityUnitspsCurrentCapacity- the psCurrentCapacitypsMaxCapacity- the psMaxCapacitypsDesignCapacity- the psDesignCapacitypsCycleCount- the psCycleCountpsChemistry- the psChemistrypsManufactureDate- the psManufactureDatepsManufacturer- the psManufacturerpsSerialNumber- the psSerialNumberpsTemperature- the psTemperature
-