Class MacPowerSourceJNA
java.lang.Object
oshi.hardware.common.AbstractPowerSource
oshi.hardware.common.platform.mac.MacPowerSource
oshi.hardware.platform.mac.MacPowerSourceJNA
- All Implemented Interfaces:
PowerSource
A Power Source
-
Nested Class Summary
Nested classes/interfaces inherited from class MacPowerSource
MacPowerSource.PowerSourceData, MacPowerSource.PowerSourceFactoryModifier and TypeClassDescriptionstatic final classRaw values read from a single IOKit Power Source (IOPS) dictionary by the JNA/FFM subclasses.protected static interfaceCreates a concrete (JNA or FFM) Mac power source from the computed battery fields.Nested classes/interfaces inherited from interface PowerSource
PowerSource.CapacityUnitsModifier and TypeInterfaceDescriptionstatic enumUnits of Battery Capacity -
Constructor Summary
ConstructorsConstructorDescriptionMacPowerSourceJNA(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 TypeMethodDescriptionstatic List<PowerSource> Gets Battery Information.protected List<PowerSource> Returns a fresh list of power sources for this platform, used byAbstractPowerSource.updateAttributes().Methods inherited from class MacPowerSource
buildPowerSourcesModifier and TypeMethodDescriptionprotected static List<PowerSource> buildPowerSources(IOKitProvider ioKit, double timeRemainingEstimated, List<MacPowerSource.PowerSourceData> sources, MacPowerSource.PowerSourceFactory factory) Reads theAppleSmartBatteryregistry entry (viaioKit) and merges it with the per-source IOPS readings into a list of power sources.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, 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.toString()booleanUpdates statistics on this battery.
-
Constructor Details
-
MacPowerSourceJNA
public MacPowerSourceJNA(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
-
queryPowerSources
Description copied from class:AbstractPowerSourceReturns a fresh list of power sources for this platform, used byAbstractPowerSource.updateAttributes(). Each concrete subclass implements this by delegating to its own staticgetPowerSources()factory method.- Specified by:
queryPowerSourcesin classAbstractPowerSource- Returns:
- A list of PowerSource objects representing batteries, etc.
-
getPowerSources
Gets Battery Information.- Returns:
- An array of PowerSource objects representing batteries, etc.
-