Hi,
On 11/29/2010 04:04 PM, a.gra...@gmail.com wrote:
Hi all,
I'd like to write an application that allows me to monitor the 3G data
traffic on my N900.
I've an option called "SuperInternet" with Tre Italy that gives you
100Mb/day Internet traffic.
It's not easy to keep track of transfered data, so I'd like to write a
desktop applet that monitor traffic and keep the amount updated.
I'm going to write this in Qt/C++.
I've some question before starting:
1) How can I detect, from a Qt/C++ application, if a 3G connection is
estabilished and when it disconnects?
2) Is it ok if I monitor the trasmitted/received data using ifconfig?
If yes, how can I execute ifconfig from an application running as
user? (Usually you can only execute ifconfig if you "sudo gainroot"
before).
Thanks for your help!
You can use DBus to monitor 3G connection states, run dbus-monitor
--system in a shell to see the paths send, then you can just use QtDbus
to connect a signal to a function in your app.
I'm not sure if ifconfig is the right way (you might also be able to use
DBus, I see something about DataCounters in dbus-monitor too), but if
you find it good enough, you can run /sbin/ifconfig and use QProcess and
read standard output, the reason you can't run it as user is that /sbin
isn't in user's $PATH (at least not by default ;))
Regards,
Mohammad Abu-Garbeyyeh
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers