ba_get_full_battery_info#
Read detailed battery diagnostics from the device.
Function Signature#
function battery = ba_get_full_battery_info()
Usage#
battery = ba_get_full_battery_info()
Outputs#
batterystruct with fields:
levelcharge in percent, 0 to 100.
healthbattery health in percent, 0 to 100.
voltagebattery voltage in millivolts.
currentcurrent in milliamperes; negative while discharging.
is_charger_connectedlogical.
charging_state‘charging’, ‘discharging_active’, ‘discharging_inactive’ or ‘unknown’.
charge_level‘good’, ‘low’, ‘critical’ or ‘unknown’.
Example#
battery = ba_get_full_battery_info()
Notes#
Requires an active device connection. Makes several Bluetooth reads, so use it sparingly; ba_get_battery_info is the quick level and charging check. A field the device could not report reads 0 or ‘unknown’.
Source File#
matlab/ba_get_full_battery_info.m