Monday, January 11, 2010

Check Battery

Detailed battery information can be found using the hal-device command in the terminal:

Nokia-N900-42-11:~# hal-device bme   
udi = '/org/freedesktop/Hal/devices/bme'
battery.charge_level.design = 8  (0x8)  (int)
battery.charge_level.current = 8  (0x8)  (int)
battery.charge_level.percentage = 96  (0x60)  (int)
battery.charge_level.last_full = 8  (0x8)  (int)
info.category = 'battery'  (string)
battery.rechargeable.is_charging = true  (bool)
battery.rechargeable.is_discharging = true  (bool)
battery.reporting.unit = 'mAh'  (string)
info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
info.addons = { 'hald-addon-bme' } (string list)
battery.reporting.design = 1261  (0x4ed)  (int)
battery.reporting.last_full = 1221  (0x4c5)  (int)
battery.reporting.current = 1221  (0x4c5)  (int)
battery.voltage.unit = 'mV'  (string)
info.capabilities = { 'battery' } (string list)
battery.voltage.current = 4185  (0x1059)  (int)
battery.remaining_time.calculate_per_time = false  (bool)
info.subsystem = 'unknown'  (string)
info.product = 'Battery (BME-HAL)'  (string)
info.udi = '/org/freedesktop/Hal/devices/bme'  (string)
battery.voltage.design = 4200  (0x1068)  (int)
maemo.charger.type = 'wall charger'  (string)
maemo.charger.connection_status = 'connected'  (string)
maemo.rechargeable.charging_status = 'full'  (string)
battery.present = true  (bool)
battery.type = 'pda'  (string)
battery.is_rechargeable = true  (bool)
battery.remaining_time = 0  (0x0)  (int)
battery.charge_level.capacity_state = 'full'  (string)
battery.charge_level.unit = 'bars'  (string)



The most interesting value is probably the battery.charge_level.percentage - which in the above example show fully charged.

Using grep to quickly get the value that is interesting would go like this:

$ hal-device bme | grep percentage

While charging the battery.voltage.design and battery.voltage.current are also interesting since charging will be completed as they approach each other.

No comments:

Post a Comment