G2A Many GEOs
SHARE
TWEET

Code for registering to network

a guest Oct 9th, 2012 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     QDBusConnection bus = QDBusConnection::systemBus();
  2.  
  3.     bus.connect("org.ofono",
  4.                 myModem,
  5.                 "org.ofono.NetworkRegistration",
  6.                 "PropertyChanged",
  7.                 this,
  8.                 SLOT(slotNetworkPropertyChanged(QString,QDBusVariant)));
  9.  
  10.     QDBusInterface iface("org.ofono",
  11.                          myModem,
  12.                          "org.ofono.NetworkRegistration",
  13.                          bus);
  14.  
  15.  
  16.  
  17.     // attempt to register to the default network
  18.     qDebug() << "registering to default network";
  19.     QDBusReply<void> result = iface.call("Register");
  20.     if (! result.isValid())
  21.     {
  22.         qDebug() << "error registering to network:" << result.error();
  23.     }
  24.     else
  25.     {
  26.         qDebug() << "registered to network";
  27.     }
  28.  
  29.  
  30.     QDBusPendingReply<QVariantMap> properties =
  31.             iface.asyncCall("GetProperties");
  32.  
  33.     QDBusPendingCallWatcher* call = new QDBusPendingCallWatcher(properties);
  34.     connect(call, SIGNAL(finished(QDBusPendingCallWatcher*)),
  35.             this, SLOT(slotGotNetworkProperties(QDBusPendingCallWatcher*)));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top