PDA

View Full Version : Looking for an event triggered Wifi enabler/disabler


Lamarque
05-07-2008, 02:21 AM
Hello!

I find it quite annoying that I have to enable and disable Wifi whenever reach/leave home/office. What I want is a small app running in the background the does the following:

-Enable Wifi when I plug my Diamond into my docking station
-Disable Wifi when
a) the wifi connection gets lost while the phone is not in the in the docking station
b) I unplug the phone out of the docking station and there is no connection to a wifi network at this moment.

So:

Is there already small app that does this?
If not: I dont think its hard to write the app of my own. Is there a forum somewhere in the web for "WM newbie-developers"?

This is all I want:


while(true) {
waitforSpecialEvent();
switch(eventType):
case connectedToPowerSupply:
setWifiEnabled(true);
break;
case disconnectedFromPowerSupply:
if (! connectedToWifi)
setWifiEnabled(false);
break;
case disconnectedFromWifi:
if (! connectedToPowerSupply)
setWifiEnabled(false);
break;
}
}

Not that hard, isnt it?

Matzix
05-07-2008, 02:30 AM
Have you heard about Phonealarm? See http://www.pocketmax.net

rabdo
05-07-2008, 04:00 AM
or SBSH PhoneWeaver

jym04
05-07-2008, 06:59 AM
I'm very positive that you can get this behavior using Mortscript.
Try searching that Mortscript accumulation thread in this forum.

TheChampJT
05-07-2008, 07:04 AM
I use Spb Phone Suite for this, maybe not worth the money if this is the only function want, but you can easily create custom profiles, which include turning Wi-Fi on-off, today plugin, which I love the most, gives easy access for managing connections. I'd say try it for free, you get a 15-day trial.

Alkhal
05-07-2008, 08:18 AM
I would say Mortscript. There really isn't a cheaper solution....

Lamarque
05-07-2008, 10:29 AM
Thanks for the Mortscript hint. Looks like this is what i was looking for.

I will try to write my own little script and let you know once its done.

Lamarque
05-07-2008, 03:45 PM
Woohoo! Works perfectly!

Unluckily Mortscript cant toggle the Wifi itself. So I installed a small app that does so and let my script execute it.

Heres my script:

While (TRUE)
inDockingStation = ExternalPowered()
RegReadDWord("HKLM", "System\State\Hardware", "Wifi", wifiStatus)
wifiEnabled = (wifiStatus MOD 4) / 2
wifiConnected = (wifiStatus MOD 32) / 16
If (inDockingStation)
If (NOT wifiEnabled)
RunWait("\Program Files\smartmadsoft\WirelessToggle\WirelessToggle.e xe")
EndIf
Else
If ((NOT wifiConnected) && wifiEnabled)
RunWait("\Program Files\smartmadsoft\WirelessToggle\WirelessToggle.e xe")
EndIf
EndIf
Sleep(30000)
EndWhile

imatrix
05-07-2008, 03:51 PM
very neat! good work