[Windows Mobile Apps and Games] camro:
Manual for SchedHandler

v1.00 22.12.2009

Features:

.) Scheduler for:

Scanning for:

-> network connection scanner (check the connection and if not valid reconnect again)

-> anti power suspend (sending power heartbeat every X-seconds, and so not going to suspend mode)

-> imap idle scanning for new emails

-> wheel time scanning (after X-seconds execute...)

--> + extra option for

---- checking if File Exist

---- checking if File Not Exist

---- checking if Application Running

---- checking if Application Not Running

Timeplans when Scanning events are valid

Execution if Scanning is valid:

-> Polling Emails (Pocket Outlook Mailboxes)

-> Kill Tasks

-> Play Sounds (all windows media supported files)

-> Switch Radio, GPRS, Wlan, Bluetooth via ON/OFF/Toggle

Conecept/Idea:

There are 2 groups:

1.) SCANNING EVENTS

2.) EXECUTION EVENTS

if the *SCANNING EVENTS* is valid, then do *EXECUTION EVENTS*

*SCANNING EVENTS WITHOUT DOING AN EXTRA EXECUTION EVENT*:

there 2 exclusion: "Network Connection" & "Power Heartbeat"

(on Event Network Connection -> this is a service which will check that the connection + try to connect

and will tell "imap idle service" if connection is good o not.

If *off*, imap idle will think, that the connection is GOOD.This event will not be used for EXECUTION events.)

This service will only be started once. IF configures multiple times, only the first in the list will be used.

(on Event Power Heartbeat -> it will send only a "power on event every X-seconds. This event will not be used for EXECUTION events.)

This service will only be started once. IF configures multiple times, only the first in the list will be used.

*SCANNING EVENTS WITH DOING AN EXTRA EXECUTION EVENT*:

Scanning event: Imap Idle if new email arraived, then do EXECUTION PLAN

Scanning event: Wheel time checking if wheeltime is over, then do EXECUTION PLAN

wheeltime have some more options and will use it as "AND" checking:

-> FileExist

-> FileNotExist

-> AppicationRunning

-> AppicationNotRunning

(ex: WHEELTIME + FILEEXIST + APPL.RUNNING = if wheeltime is over + defined file exist + application is running, if all is true, then do EXECUTION PLAN

*SCANNING EVENTS CAN BE CHECK AGAINST A SCANNING TIMEPLAN*:

if timeplans are defined with crossover times, then the offline time is smaller - better explained as: if a valid timeplan is found, then it is "ONLINE TIME".

with timeplans you can define the time where the scanning event is valid - or better explained: in undefined time, the scanning services will be paused.

if timeplan is complete disabled - then the whole time is "ONLINE" time and scanning events won't be checked against timeplan and they will then always be running.

often we are talking of "ONLINE" and OFFLINE" time.

"ONLINE" time is the defined time, where the scanning events should be done.

"OFFLINE" time is the undefined time, where the scanning events will be sleep.

*EXECUTION EVENTS*:

if the scanning event is valid, then doing this execution events:

Execution Event Polling Mailboxes (Pocket Outlook polling).

if you want, that ex: on new emails arraived on scanning event *Imap Idle*, then you must choose this option

Execution Event Execute Command Execute the command in hidden mode (incl. parameter are allowed

Execution Event Kill Task Kill all of the defined task (If multiple running, then it kills all of them)

Execution Event Play Sound Play a sound file (all files which are supported from your windows media player are allowed)

Execution Event Switch Commands You can switch Radio, GPRS, Wlan, Bluetooth.

You can switch this via: ON / OFF / TOOGLE (toogle = if on then switch off // if ON then switch it OFF)

----------------------------------------------

----------------------------------------------

Explaination of all Parameter:

----------------------------------------------

1.) Main Window

SCHEDULER PROFILES:

(list) Shows all Scheduler Profiles. If an item is disabled, then the name is shwon: name+(Sched-Dis) .

New

(button) Create a new scheduler profile.

Edit

(button) Edit an existing scheduler profile. You must select one scheduler profile in the list before clicking.

Delete

(button) Delete an existing scheduler profile. You must select one scheduler profile in the list before clicking.

IMAP IDLE MAILBOXES:

(list) Shows all Imap Idle Mailboxes. If an item is disabled, then the name is shwon: name+(Idle-Dis) .

New

(button) Create a new imap idle mailbox.

Edit

(button) Edit an existing imap idle mailbox. You must select one imap idle mailbox in the list before clicking.

Delete

(button) Delete an existing scheduler profile. You must select one imap idle mailbox in the list before clicking.

TRACE FILE:

The tracer is a seperate service, which will listen on a TCP port to catch trace informations from SchedService.

This option can be used for error finding, you can log a lot of details in extra log file.

(checkbox) There you can enable or disable it.

(Listbox) There you can input the full path+ filename for tracing (example: \Storage Card\SchedTracer.txt).

DEFAULT VALUE: \Storage Card\SchedTracer.txt

STATUSPORT FOR TRACER:

(numfield) TCP Port on which the tracer service is listen.

DEFAULT VALUE: 51982

LOG SCREEN:

Some informations can be print direct in logscreen (ex: Status, etc..).

Only system messages from SchedHandler can be displayed.

(button) If press you can switch between *maximized* or *minimized*.

----------------------------------------------

2.) Scheduler - Profile Settings

PROFILE NAME:

(checkbox) If activated, then this Scheduler Profile will be active and will be checked.

The profile can be enabled or diabled via checkbox. If Disabled it will be shown in Main Menu: name+(Sched-Dis)

TIMEPLAN VALIDATION:

(checkbox) If activated, then it will be check the scheduler profile against valid timeplans.

So you can define when your scheduler plan is active(ONLINE) and all not defined time is then "OFFLINE".

if you want to make a timeplans over midnight:

ex: 9:00 to 03:00 -> then make a plan from 00:00 to 03:00 + 9:00 to 23:59

If disabled, then it will be checked all the time (24hrs)

New

(button) Create a new timeplan + display the extra (overlayed) editor for timeplan.

scheduler profile.

Edit

(button) Edit an existing timeplan. You must select one timeplan in the list before clicking.

It will open the timeplan editor and will be delete the old timeplan. So, please you must click then *add* after changes.

Otherwise you will loose this one timeplan.

Before *hiding* the timeplan editor - check the timelist if all wanted lines in the list.

Delete

(button) Delete an existing timeplan. You must select one timeplan in the list before clicking.

-->

2a.) Scheduler - Timeplan Editor

There you can select the time (starttime and endtime).

Additional you can select(checkboxes) the days which you want to be valid.

if you want to make a timeplans over midnight: (Friday 9:00 to 03:00), then you have to do:

-> 1line = 00:00 to 03:00 (Saturday) + 1line = 9:00 to 23:59 (friday)

Add

(button) Add actual timeplan values to list. If no day8s) selected, then messge will be displayed), because it is not valid.

If you want a plan for the whole day, then select all days before.

Hide

(button) Add actual timeplan values to list. If no day8s) selected, then messge will be displayed), because it is not valid.

If you want a plan for the whole day, then select all days before.

----------------------------------------------

3.) Imap Idle - Mailbox Settings

IDLE ACTIVE:

(checkbox) If activated, then this Mailbox can be selected in the Scheduler Settings Menu and can be added to a scheduler profile.

The mailbox can be enabled or diabled via checkbox. If Disabled it will be shown in Main Menu: name+(Idle-Dis)

If Disabled, then it won't be disaplayed in the imap idle mailbox list under "Scheduler Profile - Settings".

POLLING ACTIVE:

If activated, then this Mailbox can be selected in the Scheduler Settings Menu and can be added to a scheduler profile.

MAILBOX:

[/B(textfield)] Here you can set a free definable name. This name must !not! the same as in pocket outlook account.

USER:

(textfield) Here you have to input the username from imap idle mailbox (often it is the same as your email address).

PWD:

(textfield) Here you have to input the password from imap idle mailbox.

PWD: Save

(checkbox) If enabled, then password will be saved. I strongly prefer to do so.

Your password will be saved as strong encrypted password with an special unoff. 4096bit key.

SERVER:

(textfield) Here you have to input the server domain name from imap idle mailbox (ex: imap.gmail.com).

Additional you can also input an valid ip-address, which can be also be used.

MAIL FOLDER:

(textfield) Here you have to input the Mailbox folder from imap idle mailbox (ex: INBOX).

Addional you can here insert multiple folders sperated by ";" (ex: INBOX;INBOX/Drafts;INBOX/Sent;)

But only on new login all folders will be checked and last in the list will be checked all the valid time.

If you want to check multiple FOLDERS all the time, then you must create for every FOLDER a own Imap Idle Mailbox

PORT:

(numfield) Here you have to input the port from imap idle mailbox.

DEFAULT VALUE:143 for imap(PLAIN) // 993 for imaps(SSL)

SSL:

(checkbox) Here you can select to use SLL - or if disabled PLAIN tcp will be used.

RESET SOCKET:

this is the time, where the connected imap socket will be checked ACTIVE against the server - > active= sending "IDLE" status command to server.

if the server won't answer, then would logout. otherwise do "read socket".

Gmail make timeout of connected sockets all 300sec. so a longer time as 300 won't make sense for gmail account.

Also it seems to be, that the most PDA devices cannot hold a socket longer open as 300sec only listening (without traffic).

On other imap server there can be a higher timeout be configured(my own server has 60min)

-> also after every "socket reset", the network connection and the full timeplan will used to calculate the next valid timeplan and will be rechecked if valid or not ....

- - >If timeplan is offline, then it will be sleep til next vaild timeplan.

- - >if network connection is down, then logout from server and waiting for a valid network connection

DEFAULT VALUE: 300sec for gmail account and higher values for ohter server (related on config of imap server)

FYI: Data will be send to server (IP Traffic - send "IDLE" command and server send answer back)

READ SOCKET:

this is the time how long listen on the tcp socket to get new data from server.

If this time is over, then the next round will just suddenly begin and it listen(reading socket) again.

If the time would be set to 1sec, then more cpu load, because and only 1sec will be listen and then timeout and try next round.

-> also after every "socket read", the network connection and timeplans will be rechecked if valid or not ....

- - >If timeplan is offline, then it will be sleep til next vaild timeplan.

- - >if network connection is down, then logout from server and waiting for a valid network connection

DEFAULT VALUE: i think a value 30 will be good enough

FYI: No data will be send to server (no IP Traffic output will be generated).

Settings for new power saving on IMAP IDLE:

Wheel // READ SOCKET	// READ SOCKET POWER HEARTBEAT // WHEELTIME // READ	// SLEEP // WAKEUP // Power Save

1min // 0	55	60	5	50	5	10:50

2min // 73	115	120	5	110	5	10:110

3min // 73	175	180	5	170	5	10:170

best value will be: 2min // READ SOCKET=73 // READ SOCKET POWER HEARTBEAT=115 //	(= 120sec per read)