Advertisement
Guest User

Code for registering to network

a guest
Oct 9th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.11 KB | None | 0 0
  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*)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement