Skip to content

Commit

Permalink
[ssu] Return constant IMEI list that isn't dependent on active modems…
Browse files Browse the repository at this point in the history
…. Contributes to JB#33484
  • Loading branch information
Joona Petrell committed Nov 24, 2015
1 parent a1a3ff4 commit 74a1d21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 28 deletions.
2 changes: 1 addition & 1 deletion doc/src/rndssu_clientprotocol.dox
Expand Up @@ -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

Expand Down
31 changes: 6 additions & 25 deletions libssu/ssudeviceinfo.cpp
Expand Up @@ -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<QDBusArgument>()) {
const QDBusArgument arg = v.value<QDBusArgument>();
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<QVariant> arguments = reply.arguments();
if (arguments.count() > 0) {
result = arguments.at(0).toStringList();
}

return result;
Expand Down
3 changes: 1 addition & 2 deletions libssu/ssudeviceinfo.h
Expand Up @@ -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();
/**
Expand Down

0 comments on commit 74a1d21

Please sign in to comment.