You Are Here:

Community: Developer Discussion Boards

#1 Old switch on/off smartphon... - 2006-06-15, 11:06

Join Date: Oct 2005
Posts: 2
zarkon985
Offline
Registered User
hello everyone!!

there is a instruction in python to switch on/off my smartphone?
if there isn't, where i can look for make this?

thanks in advance!
Reply With Quote

#2 Old Re: switch on/off smartphon... - 2006-07-30, 11:07

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
There's a key undocumented in key_codes.py !
It's PowerOff key=EKeyDevice2 !

Add this line to key_codes.py file
EKeyPowerOff = 63556

and now use keypress module v1.02
Code:
from key_codes import * 
import keypress 
# Display "power off and profiles menu !" 
keypress.simulate_key(EKeyPowerOff,EKeyPowerOff)


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#3 Old Talking Re: switch on/off smartphon... - 2006-08-08, 15:53

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
Quote:
Originally Posted by cyke64
There's a key undocumented in key_codes.py !
It's PowerOff key=EKeyDevice2 !

Add this line to key_codes.py file
EKeyPowerOff = 63556

and now use keypress module v1.02
Code:
from key_codes import * 
import keypress 
# Display "power off and profiles menu !" 
keypress.simulate_key(EKeyPowerOff,EKeyPowerOff)
LOL, really cute trick, that
Reply With Quote

#4 Old Re: switch on/off smartphon... - 2008-01-08, 10:07

Join Date: Dec 2007
Posts: 8
ccmroy
Offline
Registered User
Quote:
Originally Posted by cyke64 View Post
There's a key undocumented in key_codes.py !
It's PowerOff key=EKeyDevice2 !

Add this line to key_codes.py file
EKeyPowerOff = 63556
This may sound trivial but how does one add that line to a protected file? Or do we need to package an SIS to replace it?
Reply With Quote

#5 Old Re: switch on/off smartphon... - 2008-01-09, 08:31

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Hi ccmroy,

Its not a protected file!
Anyways you can also use the SWITCHOFF module...
http://discussion.forum.nokia.com/fo...d.php?t=124197
Haven't tested it yet but I guess you can try it!

BR
Croozeus
Reply With Quote

#6 Old Re: switch on/off smartphon... - 2008-01-09, 11:48

Join Date: Dec 2007
Posts: 8
ccmroy
Offline
Registered User
Its strange, what am I doing wrong? I tried using Ped to edit and save but gives me the error "Cannot save file". Same deal with other editors. Just to confirm, is the key_codes.py in the C:\resource?

rapidshare does not work well thru my ISP, anywhere else I can download the switchoff module?

I am trying to make my phone turnoff at scheduled time daily. Any chance anybody already did it so I won't need to reinvent the wheel?

Thanks for your help.
Last edited by ccmroy : 2008-01-09 at 13:19.
Reply With Quote

#7 Old Re: switch on/off smartphon... - 2008-01-15, 12:53

Join Date: Dec 2007
Posts: 8
ccmroy
Offline
Registered User
Hi again, anybody can help as above? Thanks.
Reply With Quote

#8 Old Re: switch on/off smartphon... - 2008-01-15, 13:02

Join Date: Feb 2006
Posts: 168
Location: Helsinki, Finland
RICH?
Offline
Regular Contributor
Hello,

Actually, since the line that you need to add just defines a new variable, you can write it straight into your script:

Code:
from key_codes import * 
import keypress
EKeyPowerOff = 63556
# Display "power off and profiles menu !" 
keypress.simulate_key(EKeyPowerOff,EKeyPowerOff)
That should do the trick


Best Regards
Richard


Nokia E66
PyS60 1.4.4 final
Reply With Quote

#9 Old Re: switch on/off smartphon... - 2008-01-15, 13:23

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Hey ccmroy,

Yes key_codes.py is in C:/Resource folder on 3rd Edition devices.
I had previously tested this trick on 6680 2nd Edition FP2 device.Worked Fine!
Today I tried to edit it on my N95 adn your right it a protected file on 3rd edition devices...

Quote:
I am trying to make my phone turnoff at scheduled time daily. Any chance anybody already did it so I won't need to reinvent the wheel?
In this case you could well you the xprofile module to turn your profile to Offline (which will block network) So It could work! You can find the code in the forum.
SWITCHOFF module I guess it is not uploaded correctly as It shows 0kb!

Best Regards
Croozeus
Reply With Quote

#10 Old Re: switch on/off smartphon... - 2008-01-15, 14:06

Join Date: Dec 2007
Posts: 8
ccmroy
Offline
Registered User
Thanks Rich. But when I run that script, it only quits the python interpreter. I also converted it to sis and it didn't work. Any idea why?
Reply With Quote

#11 Old Re: switch on/off smartphon... - 2008-01-15, 14:15

Join Date: Feb 2006
Posts: 168
Location: Helsinki, Finland
RICH?
Offline
Regular Contributor
Oops, it does the same on my phone too sorry, I dont know why.


Best Regards
Richard


Nokia E66
PyS60 1.4.4 final
Reply With Quote

#12 Old Re: switch on/off smartphon... - 2008-01-15, 14:35

Join Date: Dec 2007
Posts: 8
ccmroy
Offline
Registered User
Quote:
Originally Posted by croozeus View Post
Hey ccmroy,

Yes key_codes.py is in C:/Resource folder on 3rd Edition devices.
I had previously tested this trick on 6680 2nd Edition FP2 device.Worked Fine!
Today I tried to edit it on my N95 adn your right it a protected file on 3rd edition devices...

In this case you could well you the xprofile module to turn your profile to Offline (which will block network) So It could work! You can find the code in the forum.
SWITCHOFF module I guess it is not uploaded correctly as It shows 0kb!

Best Regards
Croozeus
Thanks for testing it on your N95 croozeus.

I checked out xprofile and it doesn't offer any way to shutdown the phone; it can only switch profiles.
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
Similar Threads
Thread Thread Starter Forum Replies Last Post
How Switch On/Off T9 dictionary . debasish1234 General Symbian C++ 2 2009-02-04 13:08
Circuit Switch & Packet Switch at the same time on Series60 Platform TrickLo Symbian Networking & Messaging 9 2006-04-09 16:36
Switch on/off local Bluetooth services fabrizioe General Symbian C++ 1 2004-12-23 09:01
Why master-slave switch is broken in 6600? jhnlmn Bluetooth Technology 3 2004-02-10 15:04
Sample electronic on/off switch via SMS wmasia Nokia M2M 1 2002-07-19 11:02

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