<div dir="ltr">Hey,<br><br><div class="gmail_quote">On Thu, Dec 2, 2010 at 5:43 PM, <a href="mailto:a.grandi@gmail.com">a.grandi@gmail.com</a> <span dir="ltr">&lt;<a href="mailto:a.grandi@gmail.com">a.grandi@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<br>
On 29 November 2010 15:14, Mohammad Abu-Garbeyyeh<br>
<div class="im">&lt;<a href="mailto:mohammad7410@gmail.com">mohammad7410@gmail.com</a>&gt; wrote:<br>
&gt; You can use DBus to monitor 3G connection states, run dbus-monitor --system<br>
&gt; in a shell to see the paths send, then you can just use QtDbus to connect a<br>
&gt; signal to a function in your app.<br>
<br>
</div>I&#39;ve tried your idea and I&#39;ve saved a text file with dbus log. I think<br>
this is the best way to monitor both connection, disconnection and<br>
traffic.<br>
<br>
I won&#39;t report the whole log, just a brief extract, but anyway I think<br>
that the interesting part should be this one:<br>
<br>
1) How to detect connection: this message appears once, when you have<br>
estabilished a connection.<br>
<br>
signal sender=:1.18 -&gt; dest=(null destination) serial=15255<br>
path=/com/nokia/csd/gprs/0; interface=com.nokia.csd.GPRS.Context;<br>
member=Connected<br>
   string &quot;<a href="http://tre.it" target="_blank">tre.it</a>&quot;<br>
   string &quot;IP&quot;<br>
   string &quot;gprs0&quot;<br>
   string &quot;1.87.169.88&quot;<br>
   string &quot;62.13.173.92&quot;<br>
   string &quot;62.13.173.93&quot;<br>
<br>
2) How to monitor traffic: this message appears every time there is a<br>
traffic. The two uint64 are sent and received bytes.<br>
<br>
signal sender=:1.18 -&gt; dest=(null destination) serial=15266<br>
path=/com/nokia/csd/gprs; interface=com.nokia.csd.GPRS; member=Status<br>
   array [<br>
      dict entry(<br>
         object path &quot;/com/nokia/csd/gprs/0&quot;<br>
         struct {<br>
            string &quot;<a href="http://tre.it" target="_blank">tre.it</a>&quot;<br>
            string &quot;IP&quot;<br>
            string &quot;gprs0&quot;<br>
            string &quot;1.87.169.88&quot;<br>
            boolean true<br>
            uint64 10528<br>
            uint64 38281<br>
         }<br>
      )<br>
   ]<br>
<br>
3) How to detect disconnection:<br>
<br>
signal sender=:1.18 -&gt; dest=(null destination) serial=15319<br>
path=/com/nokia/csd/gprs; interface=com.nokia.csd.GPRS;<br>
member=Suspended<br>
   uint32 3<br>
   string &quot;Detached&quot;<br>
<br>
<br>
I&#39;ve two more question now. Since I&#39;ve never worked with dbus before,<br>
is there any good example about a dbus &quot;client&quot; in Qt/C++?<br>
Is there a way to &quot;simulate&quot; those messages, so I will be able to test<br>
my application directly on my desktop, without having to build the<br>
executable for N900 and test it on the device?<br>
<br>
p.s: very last question... let me guess..... QtDbus is not available<br>
on Qt for Symbian, right :) ?<br>
<div><div></div><div class="h5"><br>
--<br>
Andrea Grandi - Nokia Qt Ambassador<br>
Maemo Community Council member<br>
website: <a href="http://www.andreagrandi.it" target="_blank">http://www.andreagrandi.it</a><br>
</div></div></blockquote></div><br>DBus in Qt is actually very simple to use, have a look at<br><a href="http://doc.trolltech.com/qq/qq20-dbus.html">http://doc.trolltech.com/qq/qq20-dbus.html</a><br>It&#39;s basically the same as QObject::connect but with DBus :)<br>
Also check keyboard-leds, it uses DBus to detect keyboard slides.<br><br>I&#39;m not sure about DBus on Symbian, BUT, I have seen DBus related files<br>in Symbian^3&#39;s Z: drive (Z:\data\dbus iirc), apparently, Symbian adopted <br>
DBus (not sure if it works the same since there isn&#39;t any shell on the N8.<br><br>Regards,<br>Mohammad Abu-Garbeyyeh<br></div>