<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"><<a href="mailto:a.grandi@gmail.com">a.grandi@gmail.com</a>></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"><<a href="mailto:mohammad7410@gmail.com">mohammad7410@gmail.com</a>> wrote:<br>
> You can use DBus to monitor 3G connection states, run dbus-monitor --system<br>
> in a shell to see the paths send, then you can just use QtDbus to connect a<br>
> signal to a function in your app.<br>
<br>
</div>I've tried your idea and I'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'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 -> dest=(null destination) serial=15255<br>
path=/com/nokia/csd/gprs/0; interface=com.nokia.csd.GPRS.Context;<br>
member=Connected<br>
string "<a href="http://tre.it" target="_blank">tre.it</a>"<br>
string "IP"<br>
string "gprs0"<br>
string "1.87.169.88"<br>
string "62.13.173.92"<br>
string "62.13.173.93"<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 -> 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 "/com/nokia/csd/gprs/0"<br>
struct {<br>
string "<a href="http://tre.it" target="_blank">tre.it</a>"<br>
string "IP"<br>
string "gprs0"<br>
string "1.87.169.88"<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 -> dest=(null destination) serial=15319<br>
path=/com/nokia/csd/gprs; interface=com.nokia.csd.GPRS;<br>
member=Suspended<br>
uint32 3<br>
string "Detached"<br>
<br>
<br>
I've two more question now. Since I've never worked with dbus before,<br>
is there any good example about a dbus "client" in Qt/C++?<br>
Is there a way to "simulate" 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'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'm not sure about DBus on Symbian, BUT, I have seen DBus related files<br>in Symbian^3's Z: drive (Z:\data\dbus iirc), apparently, Symbian adopted <br>
DBus (not sure if it works the same since there isn't any shell on the N8.<br><br>Regards,<br>Mohammad Abu-Garbeyyeh<br></div>