8#include "modemsignal.h"
10#include "modemsignal_p.h"
12#include "dbus/fakedbus.h"
17ModemManager::ModemSignalPrivate::ModemSignalPrivate(
const QString &path, ModemSignal *q)
18 : InterfacePrivate(
path, q)
26 if (modemSignalIface.isValid()) {
27 rate = modemSignalIface.rate();
28 cdma = modemSignalIface.cdma();
29 evdo = modemSignalIface.evdo();
30 gsm = modemSignalIface.gsm();
31 umts = modemSignalIface.umts();
32 lte = modemSignalIface.lte();
36ModemManager::ModemSignal::ModemSignal(
const QString &path,
QObject *parent)
37 : Interface(*new ModemSignalPrivate(
path, this), parent)
44 QStringLiteral(
"PropertiesChanged"),
51 QStringLiteral(
"PropertiesChanged"),
57ModemManager::ModemSignal::~ModemSignal()
63 Q_D(
const ModemSignal);
69 Q_D(
const ModemSignal);
75 Q_D(
const ModemSignal);
81 Q_D(
const ModemSignal);
87 Q_D(
const ModemSignal);
93 Q_D(
const ModemSignal);
100 return d->modemSignalIface.Setup(
rate);
106 d->modemSignalIface.setTimeout(
timeout);
111 Q_D(
const ModemSignal);
112 return d->modemSignalIface.timeout();
115void ModemManager::ModemSignalPrivate::onPropertiesChanged(
const QString &interface,
const QVariantMap &properties,
const QStringList &invalidatedProps)
118 Q_UNUSED(invalidatedProps);
119 qCDebug(MMQT) <<
interface << properties.keys();
121 if (interface ==
QLatin1String(MMQT_DBUS_INTERFACE_MODEM_SIGNAL)) {
122 QVariantMap::const_iterator it = properties.constFind(
QLatin1String(MM_MODEM_SIGNAL_PROPERTY_RATE));
123 if (it != properties.constEnd()) {
125 Q_EMIT q->rateChanged(rate);
127 it = properties.constFind(
QLatin1String(MM_MODEM_SIGNAL_PROPERTY_CDMA));
128 if (it != properties.constEnd()) {
129 cdma = qdbus_cast<QVariantMap>(*it);
130 Q_EMIT q->cdmaChanged(cdma);
132 it =
properties.constFind(QLatin1String(MM_MODEM_SIGNAL_PROPERTY_EVDO));
134 evdo = qdbus_cast<QVariantMap>(*it);
135 Q_EMIT q->cdmaChanged(evdo);
137 it =
properties.constFind(QLatin1String(MM_MODEM_SIGNAL_PROPERTY_GSM));
139 gsm = qdbus_cast<QVariantMap>(*it);
140 Q_EMIT q->cdmaChanged(gsm);
142 it =
properties.constFind(QLatin1String(MM_MODEM_SIGNAL_PROPERTY_UMTS));
144 umts = qdbus_cast<QVariantMap>(*it);
145 Q_EMIT q->cdmaChanged(umts);
147 it =
properties.constFind(QLatin1String(MM_MODEM_SIGNAL_PROPERTY_LTE));
149 lte = qdbus_cast<QVariantMap>(*it);
150 Q_EMIT q->cdmaChanged(lte);
155#include "moc_modemsignal.cpp"
QDBusPendingReply< void > setup(uint rate)
Setup extended signal quality information retrieval.
void setTimeout(int timeout)
Sets the timeout in milliseconds for all async method DBus calls.
int timeout() const
Returns the current value of the DBus timeout in milliseconds.
QString path(const QString &relativePath)
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
QDBusConnection sessionBus()
QDBusConnection systemBus()