[FSO] QT Dbus connection to Gypsy

Michael Tansella michael-tansella at gmx.de
Fri Oct 17 14:27:51 CEST 2008


Hi,
I'm new to QT and Dbus and I want to establish a simple connection to Gypsy. I 
looked at the Code of Kbluetooth 
http://kdebluetooth.sourcearchive.com/documentation/1:0.1-0ubuntu1/obexsession_8cpp-source.html
and tried to port it to my intensions. But unfortunately it didnt't work. 
MokoNav::isConnected() always returns FALSE.
Can you tell me if I'm on the right way or what I'm doing wrong??

Thanks
Michael Tansella 

void MokoNav::ConnectGPS()
{
QDBusConnection* dbus = new QDBusConnection("dbus");
QDBusConnection dbusconn = 
dbus->connectToBus(QDBusConnection::SessionBus, "dbus");
Service = "org.freedesktop";
sessionPath = "/org/freedesktop/Gypsy";
sessionIface = "org.freedesktop.Gypsy";
session = new QDBusInterface(Service,sessionPath,sessionIface,dbusconn);
session->call("Connect");
std::cerr << "check GPS...";
bool test = isConnected(); 
std::cerr << test;
}

bool MokoNav::isConnected()
{
QDBusReply<bool> reply = session->call("IsConnected");
if (reply.isValid())
return reply.value();
else
return false;
}




More information about the community mailing list