PDA

View Full Version : Time Controlled Switch Off/On



compuboy
24-02-2005, 07:40 PM
How bout having a time control switch off as we have time controlled switch on ( in case of Alarm ) so that we can have the mobile switched off for night automatically and is automatically switched on in the morning.

Regards

marcelt2
27-02-2005, 09:44 AM
Hello there

Well, I had this idea a while ago, and this is the result. It's not finished yet, because I cannot find a way to set the shutdown time (I'm not really good with C programming, it's my first attempt to code something in C).
The shutdown time is set to 22:00 by default, the dialog is not working (yet).

Best regards,
marcelt2

ShadoW2004
01-03-2005, 08:29 PM
Good work....!!!

May be somebody can help marcelt2 to do his script with functions:
on(at xx:xx)
off

marcelt2
02-03-2005, 07:46 AM
Thank you

Can somebody show me how to extract the hours and minutes values from a time dialog? Also, for Switch On function, I think we need to access the alarm function, does anybody know how to do that?
Mr. Yak, can you please lend a hand?

If we'll find the way to start the alarm, I think I can also make the advanced alarm script, the one that lets you select the weekdays

yak
02-03-2005, 12:41 PM
I've found SET_ALARM() function at 0x24ef7c in NHM5 6.07.

Its only arg (r0) is timestamp as returned by GET_TIMESTAMP() (0x2cb9a0).

All dialogs are "text" dialogs, their contents are then converted to time with specific functions.

Take a look at 5E0 func for alarm clock (0x25111c).

marcelt2
02-03-2005, 02:35 PM
Thank you for your answer.

I will try to use the information you gave me, although I'm testing on my 8210, I'll have to find the functions there.

NokDoc
02-03-2005, 06:08 PM
Hi,

I translated Mr. Yak's text for U:

>> I've found SET_ALARM() function at 0x24F1BC in 8210 5.31.

>> Its only arg (r0) is timestamp as returned by GET_TIMESTAMP() (0x2CC1F8.).

>> All dialogs are "text" dialogs, their contents are then converted to time with specific functions.

>> Take a look at 5E0 func for alarm clock (0x25135C).

NokDoc

compuboy
02-03-2005, 06:30 PM
Now I hope that we would soon get a Time Controlled On/Off Phone.

compuboy

mestrini
03-03-2005, 04:01 AM
Hi,

I translated Mr. Yak's text for U:

>> I've found SET_ALARM() function at 0x24F1BC in 8210 5.31.

>> Its only arg (r0) is timestamp as returned by GET_TIMESTAMP() (0x2CC1F8.).

>> All dialogs are "text" dialogs, their contents are then converted to time with specific functions.

>> Take a look at 5E0 func for alarm clock (0x25135C).

NokDoc

U sure about the values m8? :???:

I got 0x239e6c for SET_ALARM
and 0x2e3e10 for GET_TIMESTAMP

8210 v5.31

cheers

mestrini
03-03-2005, 04:12 AM
U sure about the values m8? :???:

I got 0x239e6c for SET_ALARM
and 0x2e3e10 for GET_TIMESTAMP

8210 v5.31

cheers

sorry for replying my own post but just found out that Nokdoc gave values for 3310 v6.33 :lol:

cheers :-P

marcelt2
03-03-2005, 09:44 AM
Wow, we're getting closer. Thank you all for your replies. I'll soon post the results

Best regards

NokDoc
03-03-2005, 03:07 PM
sorry for replying my own post but just found out that Nokdoc gave values for 3310 v6.33 :lol:

Hi,

Ai, yep, I took the wrong flash by mistake.

I'm very sorry for this confusion.

Seems I don't function well with temperatures below zero. ;)

NokDoc

marcelt2
05-03-2005, 04:47 PM
Hello

Although there are still some problems, concerning mostly the time dialogs, the script is now working.
It's tested only on my 8210, but it should work on others too.

marcelt2

bagiet
05-03-2005, 11:54 PM
:-o Veeeeery good script with batery saver and alarm clock at once !!!

Tested on 3310 v6.39.

marcelt2
06-03-2005, 09:28 AM
I have to update the script because I found a bug: the phone was switching off even if the autoshutdown was set to Off state.
Sorry for the inconvenience.

compuboy
06-03-2005, 11:55 AM
@marcelt2

Thats really a very good working script but i found that the Time entered should be in 24 Hrs Mode only.

Moreover, Is there any way to separate this AutoMatic Switching On from Alarm, ie , when the phone is switched on using this script the phone does not make noises.

Rest its very fine

Regards

marcelt2
07-03-2005, 07:31 AM
@compuboy

I agree, there are still some things to be done before this script is finished. I will continue to work on it.
About the switching on issue, I don't know yet if there is a way to wake up the phone without using the alarm function. Any help on this will be greatly appreciated.

Best regards

nEMO
07-03-2005, 02:46 PM
when I add this script to 3310 6.07 flash keylock dosen't work (manual and auto)...

marcelt2
07-03-2005, 03:30 PM
Sorry about that nEMO. As I said, I only tested the script on 8210 v5.26. I certainly didn't expect that.
Anything else behaving stange besides the keylock?
After spending so much time trying to make the autokeylock script, maybe we are on to something here... :-o
Just joking, of course I didn't intend that to happen.

CooBek
08-03-2005, 10:26 PM
First I would thank You for write this script ;) Also, I have problem with compiling this.. The nokix compiler was showing a message like:


# Processing: autoshutdown.nrx
Strings file: autoshutdown_ppm.txt
# SETLONG: Bad arguments!
# 140 *-* setlong autoshutdown_o_1+720 str_sw_on_ora_set
# +++ RC=1 +++
Configure with 'autoshutdown' definition
Done!


I use modded (some graphics and ringtones) 3310 soft with 6.33 version.

Cheers

marcelt2
09-03-2005, 07:29 AM
@CooBek
I'm glad you like it, and I hope it will work for you.
Did you edit the autoshutdown_ppm.txt? I think there is a problem with
@text var=text/autoshutdown/sw_on_ora_set line. Please check if it's there.

Regards

ema2000
09-03-2005, 07:35 PM
tested with nk3310 6.39 works like a charm , i've these comments
time format , i should write not only time but the : char between it
if the alarm is a second choice
i mean making menu contains
openwith alarm or not
it's realy gooooooood script
thanks very much
keep the good work

marcelt2
10-03-2005, 07:33 AM
@ema2000

Thank you.
Well, I tried to get the time dialog to work like nokia's, with no success so far.
Until I get this right, you can write anything instead of ":", I use to enter 23035 when I mean 23:35 :D
Also, because there's no validation, if you want to disable the "open with alarm" function, you can enter an invalid time, for example 25:67.
I know it's not exactly how it should be, but it works for now. I'll continue to improve this script, when I find some time.

Regards

CooBek
10-03-2005, 06:52 PM
Well done marcelt2, that works now ;) Very big thanks for You :) I was adding new ppm strings definition, because i want to have this script with translated to Polish lines in my phone.

BTW. I have one small idea.. Can you correct/change the dispmode of main menu of Your script? I don't know how correct it in code, and in my opinion the dispmode 0x80 is much better of 0xC0 ... Regards

marcelt2
11-03-2005, 07:34 AM
@CooBek

It's easy, you can make the change in the line
m=ezmenu("start",,x2d(c0),getenv("confmode/num_ro"),confid_asd_main), just replace with
m=ezmenu("start",,x2d(80),getenv("confmode/num_ro"),confid_asd_main)

Best regards

JUNT
17-03-2005, 03:19 AM
This is not working based on the latest Nokix v1.15,

# Processing: autoshutdown.nrx
Parsing strings file: autoshutdown_ppm.txt
Successfully added 7 strings.
# ERROR: Unknown dialog type!
# 105 *-* fail "Unknown dialog type!"
# +++ RC=2 +++
# 105 +++ fail "Unknown dialog type!"
# 27 +++ dlg_ora=create_dialog(5,,str_ora_set)
# Error 4 running "C:\DATA\Nokix115\scripts\CREATE_DIALOG.rx", line 105: Program interrupted

# ERROR: Script failure!

marcelt2
17-03-2005, 08:24 AM
Mr. Yak changed in this version the parameters for create_dialog
Please replace the lines:
dlg_ora=create_dialog(5,,str_ora_set)
sw_on_dlg_ora=create_dialog(5,,str_sw_on_ora_set)
with:
dlg_ora=create_dialog("input",str_ora_set,5)
sw_on_dlg_ora=create_dialog("input",str_sw_on_ora_set,5)
This fixes the error on 3310 v6.33, but not on 8210, unfortunately.

Regards

ShadoW2004
19-03-2005, 08:44 PM
Is it posible to have turn on at entered time without alarm?

JUNT
21-03-2005, 05:26 AM
Im using v6.33 and this script works great.
But one thing on my observation during shutdown, you cannot turn it on permanently, (if you turn it on after 3 seconds it goes back to off mode, you have to wait the switch on time to make your phone operational ), and my solution is to remove the battery to go back to normal.

marcelt2
21-03-2005, 07:30 AM
No, you have to wait just 1 minute, because if you try to switch on the phone just after it switched off automatically, the phone time is exactly the switch off time. It will continue to shutdown until the specified switch off time has passed.

@ShadoW2004
I don't think is possible to wake up the phone without the alarm. I may be wrong, but the only thing that can switch on the phone automatically is the alarm function, as this function is using the realtime clock (hw stuff which wakes up the sw).

JUNT
21-03-2005, 10:42 AM
No, you have to wait just 1 minute, because if you try to switch on the phone just after it switched off automatically, the phone time is exactly the switch off time. It will continue to shutdown until the specified switch off time has passed.


Tested. This is Great! thanks

mestrini
22-03-2005, 01:50 AM
No, you have to wait just 1 minute, because if you try to switch on the phone just after it switched off automatically, the phone time is exactly the switch off time. It will continue to shutdown until the specified switch off time has passed.


Well, what if u have an emergency and need to make a call during that minute? :eek:
Shouldn't the shutdown time be stored in ram so that would be erased upon turning off? and the default value upon turning on be option: Off. ?

cheers

marcelt2
22-03-2005, 07:27 AM
You are right. I'll have to make some changes to this script, soon.
I will also modify it in order to delay the shutdown if you are in the middle of a call, if possible.

Regards

vikus
10-04-2005, 07:51 PM
marcelt2 or you can put sources in C? pleas...

Sorry for my english ;-)

marcelt2
11-04-2005, 10:01 AM
Here they are.
There are still some things to correct and improve in this script, but I haven't had much free time to finish it.

Best regards

compuboy
11-04-2005, 07:23 PM
@marcelt2

Thanks for the source but i think u just forgot to handle the case when the Time is in 12 HR format.

One more thing, a configuration dialog such as dialog for setting time is recommended than that is currently present.

Regards

mestrini
11-04-2005, 11:07 PM
You are right. I'll have to make some changes to this script, soon.
I will also modify it in order to delay the shutdown if you are in the middle of a call, if possible.

Regards


I think it's easy to make that happen. Just make phone look for the ram address that controls the call state; if call_state=1 then delay, if call_state=0 then power off phone ;) check yak's locate.rx that has a routine to fnd that ram address :smile:

cheers

Vitalya
17-08-2005, 09:36 AM
autoshutdown.nrx + 3310 v6.39 +Nokix v 1.28 = ERROR


# Processing: autoshutdown.nrx
# ERROR: Unknown dialog type!
# 105 +++ fail "Unknown dialog type!"
# 27 +++ dlg_ora=create_dialog(5,,str_ora_set)
# Error 4 running "D:\MOB\NOKIXRUN\NOKIX\scripts\CREATE_DIALOG.rx", line 105: Program interrupted

Whot can i do ? :(

Vitalya
30-08-2005, 07:15 AM
Anybody can help me?

FeX
30-08-2005, 08:48 AM
@Vitalya:
don't you want to look above this same thread? ;)
17-03-2005 08:24 AM
marcelt2
17-03-2005 03:19 AM
JUNT

Vitalya
31-08-2005, 07:16 AM
Thanks. :o
I have not noticed

xury
30-11-2005, 12:54 AM
During compilation of script appears this error:

Input flash: 3330nowe.fls
# Loading... OK

# Processing: autoshutdown.nrx
# ERROR: SETBL: Destination address out of range (0x0)!
# 96 +++ setbl autoshutdown_o_1 + 126 set_alarm
# Error 4 running "C:\ WINDOWS \ Pulpit \ Nokia DCT3 \ flash edytory \ nokix \ scripts \ autoshutdown.nrx", line 96: Programme interrupted

# ERROR: Script failure!

this modified flash file for Nokia 3330 v4.50
Did anybody force to working this script from Nokia 3330 ?