[maemo-developers] Starting a 3G traffic monitoring application for N900: some questions

From: Mohammad Abu-Garbeyyeh mohammad7410 at gmail.com
Date: Fri Dec 3 17:07:03 EET 2010
Hey,

On Thu, Dec 2, 2010 at 5:43 PM, a.grandi at gmail.com <a.grandi at gmail.com>wrote:

> Hi,
>
> On 29 November 2010 15:14, Mohammad Abu-Garbeyyeh
> <mohammad7410 at 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
>

DBus in Qt is actually very simple to use, have a look at
http://doc.trolltech.com/qq/qq20-dbus.html
It's basically the same as QObject::connect but with DBus :)
Also check keyboard-leds, it uses DBus to detect keyboard slides.

I'm not sure about DBus on Symbian, BUT, I have seen DBus related files
in Symbian^3's Z: drive (Z:\data\dbus iirc), apparently, Symbian adopted
DBus (not sure if it works the same since there isn't any shell on the N8.

Regards,
Mohammad Abu-Garbeyyeh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.maemo.org/pipermail/maemo-developers/attachments/20101203/0c0190c8/attachment.htm>
More information about the maemo-developers mailing list