public class SKBatteryData extends SKAbstractData
Modifier and Type | Field and Description |
---|---|
protected int |
health |
protected int |
level |
protected int |
plugged |
protected int |
scale |
protected int |
status |
protected int |
temperature |
protected int |
voltage |
sensorType, timestamp
Constructor and Description |
---|
SKBatteryData(long timestamp,
int level,
int scale,
int temperature,
int voltage,
int plugged,
int status,
int health)
Initialize the instance
|
Modifier and Type | Method and Description |
---|---|
int |
getBatteryHealth()
Get the battery health
|
java.lang.String |
getBatteryHealthString()
Get the battery health in string format
|
int |
getBatteryStatus()
Get the battery status
|
java.lang.String |
getBatteryStatusString()
Get the battery status in string format
|
java.lang.String |
getDataInCSV()
Get the battery properties in csv format
|
int |
getLevel()
Get the battery level
|
float |
getLevelRatio()
Get the battery charge
|
int |
getPlugged()
Get the battery plugged state
|
java.lang.String |
getPluggedString()
Get the battery plugged state in string format
|
int |
getScale()
Get the battery scale
|
int |
getTemperature()
Get the battery temperature
|
int |
getVoltage()
Get the battery voltage
|
getSensorType, getTimestamp, toString
protected final int level
protected final int scale
protected final int temperature
protected final int voltage
protected final int plugged
protected final int status
protected final int health
public SKBatteryData(long timestamp, int level, int scale, int temperature, int voltage, int plugged, int status, int health)
timestamp
- Time in milliseconds (the difference between the current time and midnight, January 1, 1970 UTC)level
- Indicates the current battery charge level. Value ranges from 0 to maximum battery levelscale
- Maximum battery leveltemperature
- Current battery temperaturevoltage
- Current battery voltageplugged
- Values are: 0 - on battery, BATTERY_PLUGGED_AC, BATTERY_PLUGGED_USB, BATTERY_PLUGGED_WIRELESSstatus
- Values are: BATTERY_STATUS_CHARGING, BATTERY_STATUS_DISCHARGING, BATTERY_STATUS_FULL,
BATTERY_STATUS_NOT_CHARGING, BATTERY_STATUS_UNKNOWNhealth
- Values are: BATTERY_HEALTH_COLD, BATTERY_HEALTH_DEAD, BATTERY_HEALTH_GOOD, BATTERY_HEALTH_OVERHEAT,
BATTERY_HEALTH_OVER_VOLTAGE, BATTERY_HEALTH_UNKNOWNpublic java.lang.String getDataInCSV()
public float getLevelRatio()
public int getLevel()
public int getScale()
public int getTemperature()
public int getVoltage()
public int getPlugged()
public int getBatteryStatus()
public int getBatteryHealth()
public java.lang.String getPluggedString()
public java.lang.String getBatteryStatusString()
public java.lang.String getBatteryHealthString()