PrinterBatteryStatus

A class for printer battery status.

Overview

You use this object to know about battery in your printer.

Properties

getBatteryMounted

Whether a battery is mounted or not.

Declaration

public Ternary getBatteryMounted();

Return Value

See Ternary.

getCharging

Whether a battery is charging or not.

Declaration

public Ternary getCharging();

Return Value

See Ternary.

getChargeLevel

Get battery remaining.

Declaration

public Fraction getChargeLevel();

Return Value

See Fraction

Types

Ternary

Declaration

public enum Ternary {
    Yes,
    No,
    Unknown,
}

Fraction

A Structure representing a fraction. For example, if max is 3, current can be 0, 1, 2, or 3.

Declaration

public class Fraction {
    // min is 0

    public int getMax() {
        return max;
    }

    public int getCurrent() {
        return current;
    }

    int max;
    int current;
}