Get Battery info
Function table
__IDO_FUNCTABLE__.funcTable28Model.chargingTime
Battery info model description
- IDOGetDeviceBattInfoBluetoothModel
Parameter | Description | Notes |
---|---|---|
voltage | voltage, millivolt | int |
status | status | 0:not charging,1:charging,2:fully charged |
level | battery level | 0-100 |
lastChargingYear | Last charge time (years) | int |
lastChargingMonth | Last charging time (months) | int |
lastChargingDay | Last charging time (days) | int |
lastChargingHour | Last charging time (hours) | int |
lastChargingMinute | Last charging time (minutes) | int |
lastChargingSecond | Last charging time (seconds) | int |
command code
Objc:
[IDOFoundationCommand getBatteryInfoCommand:^(int errorCode, IDOGetDeviceBattInfoBluetoothModel * _Nullable data) {
if (errorCode == 0) {
//get success
}else if (errorCode == 6) {
//device not supported
}else {
//get failed
}
}];
Swift:
IDOFoundationCommand.getBatteryInfoCommand{ (errorCode, model) in
if errorCode == 0 {
//get success
}else if errorCode == 6 {
//device not supported
}else {
//get failed.
}
};