[8525, TyTN, MDA Vario II, JasJam General] Chalky:
GSM & 3G switching via Skschema Scripts

Hi folks,

I know some of you have beens using Mortscript to change the network band in the registry and subsequently switch to 3G or GSM by clicking.

Well I had a look at seeing if I could do something similiar using a SKschema script.

This is what I have come up with so far.

Skschema has commands which allow it to switch the radio(gsm) on/off as well as writing and deleting values/keys to the registry. (Tested on the Hermes)

SwitchToGSM.sksc

This script Writes to registry the value "1" for OpMode, pauses 1 second, turns radio off, turns radio on and connects to your data connection(GPRS ONLY).

#r(#rgset) #p(HKLM;\SOFTWARE\OEM\UMTS;OpMode;DWORD;1) #sleep(1000)
#r(#gsmoff)
#r(#gsmon)
#r(#connect)

SwitchTo3G.sksc

This script Writes to registry the value "0" for OpMode, pauses 1 second, turns radio off, turns radio on and connects to your data connection(Auto - if 3G present it will connect to that).

#r(#rgset) #p(HKLM;\SOFTWARE\OEM\UMTS;OpMode;DWORD;0) #sleep(1000)
#r(#gsmoff)
#r(#gsmon)
#r(#connect)

You could assign both these Skschema scripts to a hardware buttons, even better if you use the voice notes button on the Hermes you could use one script for [press] and the other for [press & hold].

toggle2G_3G.sksc

This script I have tried to add some intelligence into the script, I wanted to use a script for 1 hardware button and for just one [press] to switch to GSM then a second [press] to 3G - so it really toggles between the two modes.

To achieve this I used a little bit of logic and an extra key in the registry.

#r(#rgget) #p(HKCU;\Software\sk\schema\rad;Gsense;DWORD;0)
#r(#iftrue) #p(set2G)
#r(#rgset) #p(HKLM;\SOFTWARE\OEM\UMTS;OpMode;DWORD;0)
#r(#rgset) #p(HKCU;\Software\sk\schema\rad;Gsense;DWORD;0)
#r(#goto) #p(act)
#r(#label) #p(set2G)
#r(#rgset) #p(HKLM;\SOFTWARE\OEM\UMTS;OpMode;DWORD;1)
#r(#rgdelkey) #p(HKCU;\Software\sk\schema;rad)
#r(#goto) #p(act)
#r(#label) #p(act)
#r(#disconnect) #sleep(1000)
#r(#gsmoff) #sleep(1000)
#r(#gsmon)
#r(#connect)

This is how the script works the "rad" key which I have put in the Skschema registry path, is completely functionless - It's merely there as a check.

The script firstly checks to see if this key exists?

If it does then the script moves along to the "set2G" line.

If it doesn't then the script continues, The OpMode value is changed to "0" - enables AUTO mode. Then the "rad" key is created and the script moves along to the "act" label.

following along from above at the "set2G" label, OpMode value is changed to "1" - enables GSM mode only. Then the "rad" key is deleted and the script moves along to the "act" label.

At the "act" label the current data connection (if present or not) is disconnected, a pause before doing this of 1 second, the radio is switched off with another pause of 1 second, followed by switching the radio back on. Finally the data connection is re-connected.

The "rad" key is used to enable the script to decide which switching is required to GSM or to 3G.

Maybe a similar toggle action in one script could be done in Mortscript?

For anybody with Skschema I have attached the 3 script files.

Chalky.

-------

checkout Skschema tutorials