diff --git a/doc/src/rndssu_clientprotocol.dox b/doc/src/rndssu_clientprotocol.dox index 741f6a5..e820db1 100644 --- a/doc/src/rndssu_clientprotocol.dox +++ b/doc/src/rndssu_clientprotocol.dox @@ -4,7 +4,7 @@ This page contains the protocol definition used between a ssu client on a device and a ssu server. The client-side of this protocol is implemented in libssu and the ssu CLI. The server side heavily depends on the available infrastructure, and is not available in public. See \ref rndssu_implementation_notes "the implementation notes for RnD ssu" for additional details required to implement a ssu server. -$DEVICEID in the following examples is a variable filled by the ssu client before making the request, replaced by the devices IMEI (QSystemDeviceInfo::imei()), or a unique device ID (QSystemDeviceInfo::uniqueDeviceID()), if the IMEI is not available (netbooks, SDK, ...) +$DEVICEID in the following examples is a variable filled by the ssu client before making the request, replaced by the devices IMEI (from oFono ModemManager API), or WLAN mac address or device uid fallback code similar to QDeviceInfo::uniqueDeviceID(), if the IMEI is not available (netbooks, SDK, ...) @section registration Device registration diff --git a/libssu/ssudeviceinfo.cpp b/libssu/ssudeviceinfo.cpp index 201161c..311d5a0 100644 --- a/libssu/ssudeviceinfo.cpp +++ b/libssu/ssudeviceinfo.cpp @@ -251,31 +251,12 @@ ofonoGetImeis() QStringList result; QDBusMessage reply = QDBusConnection::systemBus().call( - QDBusMessage::createMethodCall("org.ofono", "/", - "org.ofono.Manager", "GetModems")); - - foreach (const QVariant &v, reply.arguments()) { - if (v.canConvert()) { - const QDBusArgument arg = v.value(); - if (arg.currentType() == QDBusArgument::ArrayType) { - arg.beginArray(); - while (!arg.atEnd()) { - if (arg.currentType() == QDBusArgument::StructureType) { - QString path; - QVariantMap props; - - arg.beginStructure(); - arg >> path >> props; - arg.endStructure(); - - if (props.contains("Serial")) { - result << props["Serial"].toString(); - } - } - } - arg.endArray(); - } - } + QDBusMessage::createMethodCall("org.ofono", "/", + "org.nemomobile.ofono.ModemManager", "GetIMEI")); + + QList arguments = reply.arguments(); + if (arguments.count() > 0) { + result = arguments.at(0).toStringList(); } return result; diff --git a/libssu/ssudeviceinfo.h b/libssu/ssudeviceinfo.h index d5c0c71..77039de 100644 --- a/libssu/ssudeviceinfo.h +++ b/libssu/ssudeviceinfo.h @@ -55,8 +55,7 @@ class SsuDeviceInfo: public QObject { Q_INVOKABLE QString deviceModel(); /** * Calculate the device ID used in ssu requests - * @return QSystemDeviceInfo::imei(), if available, or QNetworkInfo::macAddress(QNetworkInfo::WlanMode, 0), - * if available, or QSystemDeviceInfo::uniqueDeviceID() + * @return The first imei from oFono ModemManager API, if available, or WLAN mac address, or device uid fallback code similar to QDeviceInfo::uniqueDeviceID() */ Q_INVOKABLE QString deviceUid(); /**