You Are Here:

Community: Developer Discussion Boards

#1 Old sysinfo.battery() - 2008-05-10, 15:49

Join Date: Dec 2007
Posts: 409
Location: Tempe, AZ
Send a message via Yahoo to shubhendra Send a message via Skype™ to shubhendra
shubhendra's Avatar
shubhendra
Offline
Forum Nokia Champion
Someone had posted in the Request Section of Sourceforge, if there was any function in PyS60 so that he can know if the battery was charging or not?

So i thought of making solution by help of sysinfo.battery() itself, but it was frustrating to see that while charging if you print this command you just see the value stored previously.

Like if battery level was 5 before charging then this command would just show you 5 while its charging.

Any thing that can be done with this problem?


IDEAS is all they need but still they think only Genius can give them that.
Reply With Quote

#2 Old Re: sysinfo.battery() - 2008-05-10, 16:48

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
See this article, which says something like this:

Code:
from sysagent import *
from esysagent import *

status = charger_status()
#Check charger Status..Plugged in, Connected, etc
 
if status == ESAChargerConnected:
  text="Charger is connected" 
 
elif status == EESAChargerDisconnected:
  text="Charger is disconnected"
 
elif status == ESAChargerNotCharging:
  text="Charger is not charging"
 
else:
  text="Charger unknown status

print text
Reply With Quote

#3 Old Re: sysinfo.battery() - 2008-05-13, 06:13

Join Date: Dec 2007
Posts: 409
Location: Tempe, AZ
Send a message via Yahoo to shubhendra Send a message via Skype™ to shubhendra
shubhendra's Avatar
shubhendra
Offline
Forum Nokia Champion
Thanks Bogdan,

That means this module is already made. No need to ponder upon it then. But still sysinfo.battery() isn't giving correct functionality, i wish i knew something about Symbian C++.


IDEAS is all they need but still they think only Genius can give them that.
Reply With Quote

#4 Old Re: sysinfo.battery() - 2008-05-15, 08:48

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by shubhendra View Post
Thanks Bogdan,

That means this module is already made. No need to ponder upon it then. But still sysinfo.battery() isn't giving correct functionality, i wish i knew something about Symbian C++.
Doesn't it work for you?

Or it gives wrong reading?

Do let us know.

Best Regards,
Croozeus
Reply With Quote

#5 Old Re: sysinfo.battery() - 2008-05-15, 14:12

Join Date: Dec 2007
Posts: 409
Location: Tempe, AZ
Send a message via Yahoo to shubhendra Send a message via Skype™ to shubhendra
shubhendra's Avatar
shubhendra
Offline
Forum Nokia Champion
Hi croozeus

While charging if you print sysinfo.battery() you just see the value stored previously.

Like if battery level was 5 before charging then this command would just show you 5 while its charging.

According to the PyS60 Library Reference release 1.4.3 final its written

"Note: The returned value may be incorrect while the device is being charged"

under battery().


IDEAS is all they need but still they think only Genius can give them that.
Reply With Quote

#6 Old Re: sysinfo.battery() - 2008-05-15, 20:15

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by shubhendra View Post
According to the PyS60 Library Reference release 1.4.3 final its written

"Note: The returned value may be incorrect while the device is being charged"
Ah, yes the status is old while charging!
That is a limitation of the module, and as the documentation clearly mentions it, it can'nt be considered a Bug.
Rest of the time the indication it shows is correct.

Best Regards,
Croozeus
Reply With Quote

#7 Old Re: sysinfo.battery() - 2008-11-29, 00:52

Join Date: Jul 2007
Posts: 159
Location: Eindhoven, the Netherlands
hurenkam
Offline
Regular Contributor
Quote:
Originally Posted by bogdan.galiceanu View Post
See this article, which says something like this:

Code:
from sysagent import *
from esysagent import *

status = charger_status()
#Check charger Status..Plugged in, Connected, etc
 
if status == ESAChargerConnected:
  text="Charger is connected" 
 
elif status == EESAChargerDisconnected:
  text="Charger is disconnected"
 
elif status == ESAChargerNotCharging:
  text="Charger is not charging"
 
else:
  text="Charger unknown status

print text
I was looking into sysagent because I also want to check charger status, and battery status more extensively than sysinfo offers.
However, when I run the above code with a recent 1.2.0 sysagent for 3rd (as found on http://code.google.com/p/sixty/downloads/list ), the charger_status() call doesn't seem to exist. Looking at the test_sysagent.py, I can also not find any test for such functionality. I noticed that all calls now start with get_ prefix, and tried get_charger_status() but also no luck there...

Regards,
Mark.
Reply With Quote

#8 Old Re: sysinfo.battery() - 2009-05-30, 22:02

Join Date: Nov 2006
Posts: 501
neil.young
Offline
Super Contributor
No Cyke, no charging
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia