Class WindowsPowerSource

    • 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_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)