Hi,

On 29 November 2010 15:14, Mohammad Abu-Garbeyyeh
<mohammad7...@gmail.com> wrote:
> 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've tried your idea and I've saved a text file with dbus log. I think
this is the best way to monitor both connection, disconnection and
traffic.

I won't report the whole log, just a brief extract, but anyway I think
that the interesting part should be this one:

1) How to detect connection: this message appears once, when you have
estabilished a connection.

signal sender=:1.18 -> dest=(null destination) serial=15255
path=/com/nokia/csd/gprs/0; interface=com.nokia.csd.GPRS.Context;
member=Connected
   string "tre.it"
   string "IP"
   string "gprs0"
   string "1.87.169.88"
   string "62.13.173.92"
   string "62.13.173.93"

2) How to monitor traffic: this message appears every time there is a
traffic. The two uint64 are sent and received bytes.

signal sender=:1.18 -> dest=(null destination) serial=15266
path=/com/nokia/csd/gprs; interface=com.nokia.csd.GPRS; member=Status
   array [
      dict entry(
         object path "/com/nokia/csd/gprs/0"
         struct {
            string "tre.it"
            string "IP"
            string "gprs0"
            string "1.87.169.88"
            boolean true
            uint64 10528
            uint64 38281
         }
      )
   ]

3) How to detect disconnection:

signal sender=:1.18 -> dest=(null destination) serial=15319
path=/com/nokia/csd/gprs; interface=com.nokia.csd.GPRS;
member=Suspended
   uint32 3
   string "Detached"


I've two more question now. Since I've never worked with dbus before,
is there any good example about a dbus "client" in Qt/C++?
Is there a way to "simulate" those messages, so I will be able to test
my application directly on my desktop, without having to build the
executable for N900 and test it on the device?

p.s: very last question... let me guess..... QtDbus is not available
on Qt for Symbian, right :) ?

-- 
Andrea Grandi - Nokia Qt Ambassador
Maemo Community Council member
website: http://www.andreagrandi.it
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to