emit revisionChanged(value.value<QString>());
else if (property == "Serial")
emit serialChanged(value.value<QString>());
+ else if (property == "Type")
+ emit typeChanged(value.value<QString>());
else if (property == "Features")
emit featuresChanged(value.value<QStringList>());
else if (property == "Interfaces")
return m_if->properties()["Serial"].value<QString>();
}
+QString OfonoModem::type() const
+{
+ return m_if->properties()["Type"].value<QString>();
+}
+
QStringList OfonoModem::features() const
{
return m_if->properties()["Features"].value<QStringList>();
Q_PROPERTY(QString model READ model NOTIFY modelChanged)
Q_PROPERTY(QString revision READ revision NOTIFY revisionChanged)
Q_PROPERTY(QString serial READ serial NOTIFY serialChanged)
+Q_PROPERTY(QString type READ type NOTIFY typeChanged)
Q_PROPERTY(QStringList features READ features NOTIFY featuresChanged)
Q_PROPERTY(QStringList interfaces READ interfaces NOTIFY interfacesChanged)
QString model() const;
QString revision() const;
QString serial() const;
+ QString type() const;
QStringList features() const;
QStringList interfaces() const;
void modelChanged(const QString &model);
void revisionChanged(const QString &revision);
void serialChanged(const QString &serial);
+ void typeChanged(const QString &type);
void featuresChanged(const QStringList &features);
void interfacesChanged(const QStringList &interfaces);
QCOMPARE(mm->model(), QString("Synthetic Device"));
QCOMPARE(mm->revision(), QString("REV1"));
QCOMPARE(mm->serial(), QString("1234567890"));
+ QCOMPARE(mm->type(), QString("hardware"));
}
void testOfonoModemAutomatic()
QSignalSpy model(mm, SIGNAL(modelChanged(const QString &)));
QSignalSpy revision(mm, SIGNAL(revisionChanged(const QString &)));
QSignalSpy serial(mm, SIGNAL(serialChanged(const QString &)));
+ QSignalSpy type(mm, SIGNAL(typeChanged(const QString &)));
QSignalSpy features(mm, SIGNAL(featuresChanged(const QStringList &)));
QSignalSpy interfaces(mm, SIGNAL(interfacesChanged(const QStringList &)));
QCOMPARE(model.count(), 0);
QCOMPARE(revision.count(), 0);
QCOMPARE(serial.count(), 0);
+ QCOMPARE(type.count(), 0);
QCOMPARE(features.count(), 1);
QVERIFY(features.takeFirst().at(0).toStringList().count() > 0);
QCOMPARE(interfaces.count(), 1);
QCOMPARE(model.count(), 0);
QCOMPARE(revision.count(), 0);
QCOMPARE(serial.count(), 0);
+ QCOMPARE(type.count(), 0);
QCOMPARE(features.count(), 1);
QCOMPARE(features.takeFirst().at(0).toStringList().count(), 0);
QCOMPARE(interfaces.count(), 1);
revision.takeFirst();
QCOMPARE(serial.count(), 1);
serial.takeFirst();
+ QCOMPARE(type.count(), 0);
QVERIFY(features.count() > 0);
QVERIFY(features.takeLast().at(0).toStringList().count() > 0);
features.clear();
QCOMPARE(model.count(), 0);
QCOMPARE(revision.count(), 0);
QCOMPARE(serial.count(), 0);
+ QCOMPARE(type.count(), 0);
QVERIFY(features.count() > 0);
QVERIFY(features.takeLast().at(0).toStringList().count() > 0);
QVERIFY(interfaces.count() > 0);