View Full Version : [REQ]Turn on/off WiFi, depending on Bluetooth
NisseDILLIGAF
21st October 2008, 09:57 AM
Hi all!
When I woke up today, like 20 min ago!
I had an idea I would like to get on my phone..
I know a little programming, but not enough to realise this :(
ok..
When I'm at home I use wiFi to connect my phone to the internet, but when I'm not at home I don't use WiFi (like many others)
And I sometimes forget to turn it off when I'm going out,
and firstly It drains battery
second, It makes anoying beeps whenever it finds new wiFi's :mad:
(have anyone found how to turn this off permanently, every time i restart my phone it's back on again! Grr)
anyway back to to point...
My Bluetooth is always on...
transfering files when at home, and listning to music when I'm out...
So Idea (finally :rolleyes:)
When Bluetooth connects/finds my home computer it will turn on WiFi
and when it loses my home computer it will turn off WiFi..
pretty simple idea, but I think It can be pretty useful?
any programming geniuses up to te task!? :rolleyes:
Thanx to all in this Forum...!
Mr_Gee
21st October 2008, 11:55 AM
I'll look at it...
NisseDILLIGAF
21st October 2008, 03:12 PM
I'll look at it...
Nice ... :)
I've looked in msdn about bluetooth .. but I just don't know where to start...???
The idea came partly from when I'm listening to music with bluetooth headphones and are leaving my apartment..
The music stops-starts-stops-starts.... just as I'm out of range for the bluetooth...
So I thought there must be an event that u can 'hook up on' with a small app that turns off/on the wifi...?
would be great if someone (Mr_Gee?) could help me out here ..?
or maybe just point me in the right direction when it comes to the coding?
(Visual Basic is the language I'm used to)
Mr_Gee
21st October 2008, 04:12 PM
I got something, which is partially working,
do you connect to your PC when you are at home?
the problem i'm facing is that in the registry i can see what is going on, but for some reason i can't see if/when the BT is connected to the PC
the code is the same as "on but not connected", I could look up if there is an active sync connection, but i'm not sure if this is something that manually needs to be initiated.
the app does work if you are disconnected, it will stop the wifi
NisseDILLIGAF
21st October 2008, 04:29 PM
I got something, which is partially working,
do you connect to your PC when you are at home?
the problem i'm facing is that in the registry i can see what is going on, but for some reason i can't see if/when the BT is connected to the PC
the code is the same as "on but not connected", I could look up if there is an active sync connection, but i'm not sure if this is something that manually needs to be initiated.
the app does work if you are disconnected, it will stop the wifi
ok ... no, I'm not connected to my computer with active sync all the time...
So that probably isn't a solution... ?
I want it to notice if my computer is in range...
but shouldn't there be a process running that's checking if someone is connecting or sending something?
Like with the headphones, If I go out of range with them, eventually the handsfree will turn off...
Like I said... I have no idea where to go here! :rolleyes:
But Thanx! for your help on this... :)
Much appreciated!
Mr_Gee
21st October 2008, 05:18 PM
Yes that is what you would expect...
but I need to find the information somewhere :)
I'll keep looking and let you know
surur
21st October 2008, 09:25 PM
This script apparently lets you automatically activesync over bluetooth when you are close to your computer.
http://forum.xda-developers.com/showpost.php?p=1096906&postcount=5
If NOT wndExists "Connected to MEDIACENTER"
RegReadDWord HKLM, System\State\Hardware, Bluetooth, Bluetooth
If Expression %Bluetooth% <= 8
Set BluetoothWas, "Off"
Run "\Windows\ToggleBTH.exe"
Sleep 3000
EndIf
Run "\Windows\rnaapp.exe", -n -m -e"MEDIACENTER"
WaitFor "Connected to MEDIACENTER", 15
Run "\Windows\udp2tcp.exe"
Run "\Windows\rapiclnt.exe", -dppp_peer
Run "\Windows\repllog.exe", /remote /sched /h
Sleep 1000
RegWriteDWord HKLM, System\State\Hardware, Cradled, 1
While wndExists "Connected to MEDIACENTER"
Sleep 1000
EndWhile
Run "\Program Files\MortScript\TKill.exe", UDP to TCP proxy
Run "\Program Files\MortScript\TKill.exe", Remote API Client
Run "\Program Files\MortScript\TKill.exe", ActiveSync
If equals %BluetoothWas%, "Off"
Run "\Windows\ToggleBTH.exe"
EndIf
Else
Run "\Program Files\MortScript\TKill.exe", Connected to MEDIACENTER
EndIf
One could easily inset a wifi toggle softcut in there somewhere.
Surur
NisseDILLIGAF
21st October 2008, 10:01 PM
This script apparently lets you automatically activesync over bluetooth when you are close to your computer.
http://forum.xda-developers.com/showpost.php?p=1096920&postcount=6
....
One could easily inset a wifi toggle softcut in there somewhere.
Surur
Nice find...
but I don't think it will run the script when I'm close to my computer...
looks like u run the script and it activates bluetooth runs activesync and then closes the connection ...
surur
21st October 2008, 10:15 PM
Nice find...
but I don't think it will run the script when I'm close to my computer...
looks like u run the script and it activates bluetooth runs activesync and then closes the connection ...
Presumably you could put it in a loop and check for success or failure of the activesync connection. Reading the script is not ideal however.
Surur
le_cactus
21st October 2008, 10:25 PM
This script apparently lets you automatically activesync over bluetooth when you are close to your computer.
http://forum.xda-developers.com/showpost.php?p=1096906&postcount=5
One could easily inset a wifi toggle softcut in there somewhere.
Surur
Hi,
That script is indeed only one-click sync, in that particular script it's over GRPS/UMTS. I made such a script for Bluetooth also, but it's only to sync. I still haven't found a way to auto-connect to your Bluetooth or WIFI source without a script continuesly looping and there for draining the battery and the CPU.
In this (http://forum.xda-developers.com/showthread.php?t=435817) thread however mjg7876 asked for ideas, put up a vote and apperantly the event driven application got the most votes. I suggested just such a feature; raise an event when a particular BT device is connectable. All we can do is hope mjg7876 gets started on the project soon, and finds a non-battery-draining way in C++ make it happen.
Cheers,
Cacti
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.