PDA

View Full Version : Battery reading


hopbeat
10-21-2009, 03:00 PM
Could anyone point me to the library that would allow me to read the status of the battery on N900 (using c++) ?

Thanks!

danielwilms
10-22-2009, 03:36 AM
Hi,

you could have a look at the hal documentation (http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Using_Generic_Platform_Components/Using_HAL), and the libhal API (http://http://maemo.org/api_refs/5.0/5.0-final/libhal/libhal-libhal.html).

On device there is the command lshal, where you can get information about the device states. The battery namespace of the specification you will find here (http://www.marcuscom.com/hal-spec/hal-spec.html#device-properties-battery). You might be interested in the "battery.charge_level.percentage".

Hope this helped,

Cheers Daniel

hopbeat
10-22-2009, 03:45 AM
Thanks! I will take a look at that.