maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Need help with development (https://talk.maemo.org/showthread.php?t=73880)

marmistrz 2011-06-09 18:11

Need help with development
 
Hi
I'm doing a program on battery state but have a problem. I use lshal and on omap kernel the output is different than in kernel power 46. Could somebody post
Code:

lshal | grep battery
for kernel power47, kernel power42 and other if somebody has
thanks in advance

dwaradzyn 2011-06-09 18:15

Re: Need help with development
 
I have kernel power 46 an the output is:
Code:

  battery.charge_level.capacity_state = 'ok'  (string)
  battery.charge_level.current = 6  (0x6)  (int)
  battery.charge_level.design = 8  (0x8)  (int)
  battery.charge_level.last_full = 0  (0x0)  (int)
  battery.charge_level.percentage = 61  (0x3d)  (int)
  battery.charge_level.unit = 'bars'  (string)
  battery.is_rechargeable = true  (bool)
  battery.present = true  (bool)
  battery.rechargeable.is_charging = false  (bool)
  battery.rechargeable.is_discharging = true  (bool)
  battery.remaining_time = 7200  (0x1c20)  (int)
  battery.remaining_time.calculate_per_time = false  (bool)
  battery.reporting.current = 758  (0x2f6)  (int)
  battery.reporting.design = 1242  (0x4da)  (int)
  battery.reporting.last_full = 0  (0x0)  (int)
  battery.reporting.unit = 'mAh'  (string)
  battery.type = 'pda'  (string)
  battery.voltage.current = 3607  (0xe17)  (int)
  battery.voltage.design = 4200  (0x1068)  (int)
  battery.voltage.unit = 'mV'  (string)
  info.capabilities = {'battery'} (string list)
  info.category = 'battery'  (string)


mr id 2011-06-09 18:34

Re: Need help with development
 
kernel power 47
Code:

  battery.charge_level.capacity_state = 'ok'  (string)
  battery.charge_level.current = 6  (0x6)  (int)
  battery.charge_level.design = 8  (0x8)  (int)
  battery.charge_level.last_full = 8  (0x8)  (int)
  battery.charge_level.percentage = 60  (0x3c)  (int)
  battery.charge_level.unit = 'bars'  (string)
  battery.is_rechargeable = true  (bool)
  battery.present = true  (bool)
  battery.rechargeable.is_charging = false  (bool)
  battery.rechargeable.is_discharging = true  (bool)
  battery.remaining_time = 10800  (0x2a30)  (int)
  battery.remaining_time.calculate_per_time = false  (bool)
  battery.reporting.current = 748  (0x2ec)  (int)
  battery.reporting.design = 1231  (0x4cf)  (int)
  battery.reporting.last_full = 1223  (0x4c7)  (int)
  battery.reporting.unit = 'mAh'  (string)
  battery.type = 'pda'  (string)
  battery.voltage.current = 3880  (0xf28)  (int)
  battery.voltage.design = 4200  (0x1068)  (int)
  battery.voltage.unit = 'mV'  (string)
  info.capabilities = {'battery'} (string list)
  info.category = 'battery'  (string)


colin.stephane 2011-06-09 18:35

Re: Need help with development
 
Quote:

Originally Posted by marmistrz (Post 1025912)
Hi
I'm doing a program on battery state but have a problem. I use lshal and on omap kernel the output is different than in kernel power 46. Could somebody post
Code:

lshal | grep battery
for kernel power47, kernel power42 and other if somebody has
thanks in advance

Here is the FIX :

Code:

clear && ID=$(id -un) ; if [ ${ID} != "root" ] ; then echo "You are not 'root', please use this command line as 'root' ..." ; else echo "Ok, you are 'root' ..." ; if grep -q "bq27x00_battery" /etc/modprobe.d/blacklist 2>/dev/null ; then echo "Patch already applyed, nothing to be done ..." ; echo "" ; else echo "Applying patch now ..." ; echo "blacklist bq27x00_battery" >>/etc/modprobe.d/blacklist ; echo "" ; echo "DONE, PLEASE REBOOT YOUR DEVICE ..." ; echo "" ; fi ; fi
A++

PS : Obviously after the patch (blacklisting bad module) all kernel's report same values ...

marmistrz 2011-06-10 16:31

Re: Need help with development
 
thanks!
and is there any problem if I patch the omap kernel?

marmistrz 2011-06-11 16:59

Re: Need help with development
 
the problem still exist after patching


All times are GMT. The time now is 15:03.

vBulletin® Version 3.8.8