View Single Post
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#4
Originally Posted by gorgezilla View Post
tried that. it doesn't do what I am asking for
Hmm. Depending on what you are asking for, it might be modified to do that... The question is, do you

(a) want the device to recognize that packets are being transferred heavily, and whenever that happens, step up to 3G mode, or

(b) want the device to recognize when you run one of a select group of processes, and when doing so, shift up to 3G.

For (a), the core code of "AutoDisconnect" appears to be a script that polls the system's packet counter, and acts whenever the number of packets drops to a low enough amount per unit time. In theory, it wouldn't be hard to do the reverse -- check for a significant enough spike in the number of packets being passed, and shift up if that happens. Of course, this has the significant drawbacks that (1) the polling system will take a while to recognize that you've started a large data transfer, and (2) when it makes the shift, you'll be stuck waiting for a fairly significant amount of time (possibly triggering timeouts in some pieces of software).

For (b), things are a bit tougher. You can't tell which programs are actively using the network just by looking at some packet statistics. Honestly, it'd be easier to modify the programs themselves to ask for a shift up to 3G before they initiate a significant data transfer. I guess you could wrap the program in a shell script when you run it, something like:

Code:
#!/usr/bin/sh
dbus-send command-to-shift-up-to-3G
run_heavy_data_transfer_program
dbus-send command-to-shift-back-to-2G
Of course, you have to be careful when fiddling with this stuff, as it would probably hang up the phone if you run it while you're connected to someone else...

In any case, I'm a newbie to the n900; I suspect others here have probably looked into stuff like this before.