ModemManagerQt

modem.cpp
1/*
2 SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org>
3 SPDX-FileCopyrightText: 2010 Lamarque Souza <lamarque@kde.org>
4 SPDX-FileCopyrightText: 2013 Daniel Nicoletti <dantti12@gmail.com>
5 SPDX-FileCopyrightText: 2013 Lukas Tinkl <ltinkl@redhat.com>
6 SPDX-FileCopyrightText: 2013-2015 Jan Grulich <jgrulich@redhat.com>
7
8 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
9*/
10
11#include "modem.h"
12#include "modem_p.h"
13
14#ifdef MMQT_STATIC
15#include "dbus/fakedbus.h"
16#else
17#include "dbus/dbus.h"
18#endif
19#include "generictypes_p.h"
20#include "mmdebug_p.h"
21
22#include <QTimer>
23
24namespace ModemManager
25{
26class ModemManager::BearerProperties::Private
27{
28public:
29 Private()
30 {
31 }
32 QString apn;
33 MMBearerIpFamily ipType;
34 MMBearerAllowedAuth allowedAuth;
35 QString user;
36 QString password;
37 bool allowRoaming;
38 MMModemCdmaRmProtocol rmProtocol;
39 QString number;
40};
41
42}
43
48
50 : d(new Private)
51{
52 *this = other;
53}
54
59
61{
62 return d->apn;
63}
64
66{
67 d->apn = apn;
68}
69
71{
72 return d->ipType;
73}
74
75void ModemManager::BearerProperties::setIpType(MMBearerIpFamily ipType)
76{
77 d->ipType = ipType;
78}
79
81{
82 return d->allowedAuth;
83}
84
86{
87 d->allowedAuth = allowedAuth;
88}
89
91{
92 return d->user;
93}
94
96{
97 d->user = user;
98}
99
101{
102 return d->password;
103}
104
106{
107 d->password = password;
108}
109
111{
112 return d->allowRoaming;
113}
114
116{
117 d->allowRoaming = allow;
118}
119
121{
122 return d->rmProtocol;
123}
124
125void ModemManager::BearerProperties::setRmProtocol(MMModemCdmaRmProtocol rmProtocol)
126{
127 d->rmProtocol = rmProtocol;
128}
129
134
136{
137 d->number = number;
138}
139
141{
142 if (this == &other) {
143 return *this;
144 }
145
146 *d = *other.d;
147 return *this;
148}
149
150ModemManager::ModemPrivate::ModemPrivate(const QString &path, Modem *q)
151 : InterfacePrivate(path, q)
152#ifdef MMQT_STATIC
153 , modemIface(QLatin1String(MMQT_DBUS_SERVICE), path, QDBusConnection::sessionBus())
154#else
155 , modemIface(QLatin1String(MMQT_DBUS_SERVICE), path, QDBusConnection::systemBus())
156#endif
157 , q_ptr(q)
158{
159 if (modemIface.isValid()) {
160 simPath = modemIface.sim().path();
161 Q_FOREACH (uint cap, modemIface.supportedCapabilities()) {
162 supportedCapabilities.append((MMModemCapability)cap);
163 }
164 currentCapabilities = (QFlags<MMModemCapability>)modemIface.currentCapabilities();
165 maxBearers = modemIface.maxBearers();
166 maxActiveBearers = modemIface.maxActiveBearers();
167 manufacturer = modemIface.manufacturer();
168 model = modemIface.model();
169 revision = modemIface.revision();
170 deviceIdentifier = modemIface.deviceIdentifier();
171 device = modemIface.device();
172 drivers = modemIface.drivers();
173 plugin = modemIface.plugin();
174 primaryPort = modemIface.primaryPort();
175 ports = modemIface.ports();
176 equipmentIdentifier = modemIface.equipmentIdentifier();
177 unlockRequired = (MMModemLock)modemIface.unlockRequired();
178 unlockRetries = modemIface.unlockRetries();
179 state = (MMModemState)modemIface.state();
180 stateFailedReason = (MMModemStateFailedReason)modemIface.stateFailedReason();
181 accessTechnologies = (ModemManager::Modem::AccessTechnologies)modemIface.accessTechnologies();
182 signalQuality = modemIface.signalQuality();
183 ownNumbers = modemIface.ownNumbers();
184 powerState = (MMModemPowerState)modemIface.powerState();
185 supportedModes = modemIface.supportedModes();
186 currentModes = modemIface.currentModes();
187 Q_FOREACH (uint band, modemIface.supportedBands()) {
188 supportedBands.append((MMModemBand)band);
189 }
190 Q_FOREACH (uint band, modemIface.currentBands()) {
191 currentBands.append((MMModemBand)band);
192 }
193 supportedIpFamilies = (ModemManager::Modem::IpBearerFamilies)modemIface.supportedIpFamilies();
194
195 QTimer::singleShot(0, this, &ModemManager::ModemPrivate::initializeBearers);
196 }
197}
198
199void ModemManager::ModemPrivate::initializeBearers()
200{
201 Q_Q(Modem);
202
203#if MM_CHECK_VERSION(1, 2, 0)
204 QList<QDBusObjectPath> bearersList = modemIface.bearers();
205 Q_FOREACH (const QDBusObjectPath &bearer, bearersList) {
206 if (!bearers.contains(bearer.path())) {
207 bearers.insert(bearer.path(), Bearer::Ptr());
208 Q_EMIT q->bearerAdded(bearer.path());
209 }
210 }
211#else
212 QDBusPendingReply<QList<QDBusObjectPath>> reply = modemIface.ListBearers();
213 reply.waitForFinished();
214 if (reply.isValid()) {
215 Q_FOREACH (const QDBusObjectPath &bearer, reply.value()) {
216 if (!bearers.contains(bearer.path())) {
217 bearers.insert(bearer.path(), Bearer::Ptr());
218 Q_EMIT q->bearerAdded(bearer.path());
219 }
220 }
221 }
222#endif
223}
224
225ModemManager::Modem::Modem(const QString &path, QObject *parent)
226 : Interface(*new ModemPrivate(path, this), parent)
227{
228 Q_D(Modem);
229
230 qRegisterMetaType<AccessTechnologies>();
231 qRegisterMetaType<Capabilities>();
232 qRegisterMetaType<ModemModes>();
233 qRegisterMetaType<IpBearerFamilies>();
234 qRegisterMetaType<MMModemLock>();
235 qRegisterMetaType<MMModemPowerState>();
236 qRegisterMetaType<MMModemState>();
237 qRegisterMetaType<MMModemStateChangeReason>();
238 qRegisterMetaType<MMModemStateFailedReason>();
239
240 if (d->modemIface.isValid()) {
241#ifdef MMQT_STATIC
243 d->uni,
244 QLatin1String(DBUS_INTERFACE_PROPS),
245 QLatin1String("PropertiesChanged"),
246 d,
247 SLOT(onPropertiesChanged(QString, QVariantMap, QStringList)));
248#else
250 d->uni,
251 QLatin1String(DBUS_INTERFACE_PROPS),
252 QLatin1String("PropertiesChanged"),
253 d,
254 SLOT(onPropertiesChanged(QString, QVariantMap, QStringList)));
255#endif
256 }
257
258 connect(&d->modemIface, &OrgFreedesktopModemManager1ModemInterface::StateChanged, d, &ModemPrivate::onStateChanged);
259}
260
261ModemManager::Modem::~Modem()
262{
263}
264
265QString ModemManager::Modem::uni() const
266{
267 Q_D(const Modem);
268 return d->uni;
269}
270
272{
273 Q_D(const Modem);
274 return (MMModemPowerState)d->powerState == MM_MODEM_POWER_STATE_ON;
275}
276
277bool ModemManager::Modem::isValid() const
278{
279 Q_D(const Modem);
280 return d->modemIface.isValid();
281}
282
284{
285 Q_D(Modem);
286 return d->modemIface.Enable(enable);
287}
288
290{
291 Q_D(Modem);
292 QVariantMap map;
293 map.insert(QStringLiteral("apn"), bearerProperties.apn());
294 if (bearerProperties.ipType() != MM_BEARER_IP_FAMILY_NONE) {
295 map.insert(QStringLiteral("ip-type"), (uint)bearerProperties.ipType());
296 }
297 if (bearerProperties.allowedAuthentication() != MM_BEARER_ALLOWED_AUTH_UNKNOWN) {
298 map.insert(QStringLiteral("allowed-auth"), (uint)bearerProperties.allowedAuthentication());
299 }
300 if (!bearerProperties.user().isEmpty()) {
301 map.insert(QStringLiteral("user"), bearerProperties.user());
302 }
303 if (!bearerProperties.password().isEmpty()) {
304 map.insert(QStringLiteral("password"), bearerProperties.password());
305 }
306 map.insert(QStringLiteral("allow-roaming"), bearerProperties.allowRoaming());
307 if (bearerProperties.rmProtocol() != MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) {
308 map.insert(QStringLiteral("rm-protocol"), (uint)bearerProperties.rmProtocol());
309 }
310 if (!bearerProperties.number().isEmpty()) {
311 map.insert(QStringLiteral("number"), bearerProperties.number());
312 }
313 return d->modemIface.CreateBearer(map);
314}
315
317{
318 Q_D(Modem);
319 return d->modemIface.DeleteBearer(QDBusObjectPath(bearer));
320}
321
323{
324 Q_D(const Modem);
325
327 QMap<QString, Bearer::Ptr>::const_iterator i = d->bearers.constBegin();
328 while (i != d->bearers.constEnd()) {
329 ModemManager::Bearer::Ptr bearer = const_cast<ModemPrivate *>(d)->findRegisteredBearer(i.key());
330 if (bearer) {
331 list << bearer;
332 }
333 ++i;
334 }
335 return list;
336}
337
339{
340 Q_D(const Modem);
341 return const_cast<ModemPrivate *>(d)->findRegisteredBearer(bearer);
342}
343
345{
346 Q_D(Modem);
347 return d->modemIface.Reset();
348}
349
351{
352 Q_D(Modem);
353 return d->modemIface.FactoryReset(code);
354}
355
357{
358 Q_D(Modem);
359 return d->modemIface.SetPowerState(state);
360}
361
363{
364 Q_D(Modem);
365 return d->modemIface.SetCurrentCapabilities((uint)caps);
366}
367
369{
370 Q_D(Modem);
371 return d->modemIface.SetCurrentModes(mode);
372}
373
375{
376 Q_D(Modem);
377 QList<uint> tmp;
378 Q_FOREACH (const MMModemBand band, bands) {
379 tmp.append(band);
380 }
381 return d->modemIface.SetCurrentBands(tmp);
382}
383
384QDBusPendingReply<QString> ModemManager::Modem::command(const QString &cmd, uint timeout)
385{
386 Q_D(Modem);
387 return d->modemIface.Command(cmd, timeout);
388}
389
391{
392 Q_D(const Modem);
393 return d->simPath;
394}
395
397{
398 Q_D(const Modem);
399 return d->supportedCapabilities;
400}
401
403{
404 Q_D(const Modem);
405 return d->currentCapabilities;
406}
407
409{
410 Q_D(const Modem);
411 return d->maxBearers;
412}
413
415{
416 Q_D(const Modem);
417 return d->maxActiveBearers;
418}
419
421{
422 Q_D(const Modem);
423 return d->manufacturer;
424}
425
427{
428 Q_D(const Modem);
429 return d->model;
430}
431
433{
434 Q_D(const Modem);
435 return d->revision;
436}
437
439{
440 Q_D(const Modem);
441 return d->deviceIdentifier;
442}
443
445{
446 Q_D(const Modem);
447 return d->device;
448}
449
451{
452 Q_D(const Modem);
453 return d->drivers;
454}
455
457{
458 Q_D(const Modem);
459 return d->plugin;
460}
461
463{
464 Q_D(const Modem);
465 return d->primaryPort;
466}
467
469{
470 Q_D(const Modem);
471 return d->ports;
472}
473
475{
476 Q_D(const Modem);
477 return d->equipmentIdentifier;
478}
479
481{
482 Q_D(const Modem);
483 return d->unlockRequired;
484}
485
487{
488 Q_D(const Modem);
489 return d->unlockRetries;
490}
491
492MMModemState ModemManager::Modem::state() const
493{
494 Q_D(const Modem);
495 return d->state;
496}
497
498MMModemStateFailedReason ModemManager::Modem::stateFailedReason() const
499{
500 Q_D(const Modem);
501 return d->stateFailedReason;
502}
503
505{
506 Q_D(const Modem);
507 return d->accessTechnologies;
508}
509
510ModemManager::SignalQualityPair ModemManager::Modem::signalQuality() const
511{
512 Q_D(const Modem);
513 return d->signalQuality;
514}
515
517{
518 Q_D(const Modem);
519 return d->ownNumbers;
520}
521
522MMModemPowerState ModemManager::Modem::powerState() const
523{
524 Q_D(const Modem);
525 return d->powerState;
526}
527
529{
530 Q_D(const Modem);
531 return d->supportedModes;
532}
533
534ModemManager::CurrentModesType ModemManager::Modem::currentModes() const
535{
536 Q_D(const Modem);
537 return d->currentModes;
538}
539
541{
542 Q_D(const Modem);
543 return d->supportedBands;
544}
545
547{
548 Q_D(const Modem);
549 return d->currentBands;
550}
551
553{
554 Q_D(const Modem);
555 return d->supportedIpFamilies;
556}
557
558ModemManager::Bearer::Ptr ModemManager::ModemPrivate::findRegisteredBearer(const QString &path)
559{
560 Q_Q(Modem);
562 if (!path.isEmpty()) {
563 bool contains = bearers.contains(path);
564 if (contains && bearers.value(path)) {
565 ret = bearers.value(path);
566 } else {
568 bearers[path] = ret;
569 if (!contains) {
570 Q_EMIT q->bearerAdded(path);
571 }
572 }
573 }
574 return ret;
575}
576
578{
579 Q_D(Modem);
580 d->modemIface.setTimeout(timeout);
581}
582
584{
585 Q_D(const Modem);
586 return d->modemIface.timeout();
587}
588
589void ModemManager::ModemPrivate::onPropertiesChanged(const QString &ifaceName, const QVariantMap &changedProps, const QStringList &invalidatedProps)
590{
591 Q_UNUSED(invalidatedProps);
592 Q_Q(Modem);
593 qCDebug(MMQT) << ifaceName << changedProps.keys();
594
595 if (ifaceName == QLatin1String(MMQT_DBUS_INTERFACE_MODEM)) {
596 QVariantMap::const_iterator it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_SIM));
597
598 if (it != changedProps.constEnd()) {
599 Q_EMIT q->simPathChanged(simPath, it->toString());
600 simPath = it->toString();
601 }
602#if MM_CHECK_VERSION(1, 2, 0)
603 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_BEARERS));
604 if (it != changedProps.constEnd()) {
605 QList<QDBusObjectPath> bearerPaths = qdbus_cast<QList<QDBusObjectPath>>(*it);
606 if (bearerPaths.isEmpty()) {
607 QMap<QString, Bearer::Ptr>::const_iterator it = bearers.constBegin();
608 while (it != bearers.constEnd()) {
609 Q_EMIT q->bearerRemoved(it.key());
610 ++it;
611 }
612 bearers.clear();
613 } else {
614 QStringList knownBearers = bearers.keys();
615 Q_FOREACH (const QDBusObjectPath &bearer, bearerPaths) {
616 if (!bearers.contains(bearer.path())) {
617 bearers.insert(bearer.path(), ModemManager::Bearer::Ptr());
618 Q_EMIT q->bearerAdded(bearer.path());
619 } else {
620 knownBearers.removeOne(bearer.path());
621 }
622 }
623 Q_FOREACH (const QString &path, knownBearers) {
624 bearers.remove(path);
625 Q_EMIT q->bearerRemoved(path);
626 }
627 }
628 Q_EMIT q->bearersChanged();
629 }
630#endif
631 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_SUPPORTEDCAPABILITIES));
632 if (it != changedProps.constEnd()) {
633 supportedCapabilities.clear();
634 Q_FOREACH (const uint cap, qdbus_cast<QList<uint>>(*it)) {
635 supportedCapabilities << ((MMModemCapability)cap);
636 }
637 Q_EMIT q->supportedCapabilitiesChanged(supportedCapabilities);
638 }
639 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_CURRENTCAPABILITIES));
640 if (it != changedProps.constEnd()) {
641 currentCapabilities = (QFlags<MMModemCapability>)it->toUInt();
642 Q_EMIT q->currentCapabilitiesChanged(currentCapabilities);
643 }
644 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_MAXBEARERS));
645 if (it != changedProps.constEnd()) {
646 maxBearers = it->toUInt();
647 Q_EMIT q->maxBearersChanged(maxBearers);
648 }
649 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_MAXACTIVEBEARERS));
650 if (it != changedProps.constEnd()) {
651 maxActiveBearers = it->toUInt();
652 Q_EMIT q->maxActiveBearersChanged(maxActiveBearers);
653 }
654 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_MANUFACTURER));
655 if (it != changedProps.constEnd()) {
656 manufacturer = it->toString();
657 Q_EMIT q->manufacturerChanged(manufacturer);
658 }
659 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_MODEL));
660 if (it != changedProps.constEnd()) {
661 model = it->toString();
662 Q_EMIT q->modelChanged(model);
663 }
664 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_REVISION));
665 if (it != changedProps.constEnd()) {
666 revision = it->toString();
667 Q_EMIT q->revisionChanged(revision);
668 }
669 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_DEVICEIDENTIFIER));
670 if (it != changedProps.constEnd()) {
671 deviceIdentifier = it->toString();
672 Q_EMIT q->deviceIdentifierChanged(deviceIdentifier);
673 }
674 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_DEVICE));
675 if (it != changedProps.constEnd()) {
676 device = it->toString();
677 Q_EMIT q->deviceChanged(device);
678 }
679 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_DRIVERS));
680 if (it != changedProps.constEnd()) {
681 drivers = it->toStringList();
682 Q_EMIT q->driversChanged(drivers);
683 }
684 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_PLUGIN));
685 if (it != changedProps.constEnd()) {
686 plugin = it->toString();
687 Q_EMIT q->pluginChanged(plugin);
688 }
689 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_PRIMARYPORT));
690 if (it != changedProps.constEnd()) {
691 primaryPort = it->toString();
692 Q_EMIT q->primaryPortChanged(primaryPort);
693 }
694 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_PORTS));
695 if (it != changedProps.constEnd()) {
696 ports = qdbus_cast<QList<Port>>(*it);
697 Q_EMIT q->portsChanged(ports);
698 }
699 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_EQUIPMENTIDENTIFIER));
700 if (it != changedProps.constEnd()) {
701 equipmentIdentifier = it->toString();
702 Q_EMIT q->equipmentIdentifierChanged(equipmentIdentifier);
703 }
704 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_UNLOCKREQUIRED));
705 if (it != changedProps.constEnd()) {
706 unlockRequired = (MMModemLock)it->toUInt();
707 Q_EMIT q->unlockRequiredChanged(unlockRequired);
708 }
709 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_UNLOCKRETRIES));
710 if (it != changedProps.constEnd()) {
711 unlockRetries = qdbus_cast<UnlockRetriesMap>(*it);
712 Q_EMIT q->unlockRetriesChanged(unlockRetries);
713 }
714 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_STATE));
715 if (it != changedProps.constEnd()) {
716 // Should be handled by StateChanged signal
717 // Q_EMIT q->stateChanged(state, (MMModemState)it->toInt());
718 // state = (MMModemState)it->toInt();
719 }
720 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_STATEFAILEDREASON));
721 if (it != changedProps.constEnd()) {
722 stateFailedReason = (MMModemStateFailedReason)it->toUInt();
723 Q_EMIT q->stateFailedReasonChanged(stateFailedReason);
724 }
725 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_ACCESSTECHNOLOGIES));
726 if (it != changedProps.constEnd()) {
727 accessTechnologies = (ModemManager::Modem::AccessTechnologies)it->toUInt();
728 Q_EMIT q->accessTechnologiesChanged(accessTechnologies);
729 }
730 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_SIGNALQUALITY));
731 if (it != changedProps.constEnd()) {
732 signalQuality = qdbus_cast<SignalQualityPair>(*it);
733 Q_EMIT q->signalQualityChanged(signalQuality);
734 }
735 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_OWNNUMBERS));
736 if (it != changedProps.constEnd()) {
737 ownNumbers = it->toStringList();
738 Q_EMIT q->ownNumbersChanged(ownNumbers);
739 }
740 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_POWERSTATE));
741 if (it != changedProps.constEnd()) {
742 powerState = (MMModemPowerState)it->toUInt();
743 Q_EMIT q->powerStateChanged(powerState);
744 }
745 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_SUPPORTEDMODES));
746 if (it != changedProps.constEnd()) {
747 supportedModes = qdbus_cast<SupportedModesType>(*it);
748 Q_EMIT q->supportedModesChanged(supportedModes);
749 }
750 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_CURRENTMODES));
751 if (it != changedProps.constEnd()) {
752 currentModes = qdbus_cast<CurrentModesType>(*it);
753 Q_EMIT q->currentModesChanged(currentModes);
754 }
755 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_SUPPORTEDBANDS));
756 if (it != changedProps.constEnd()) {
757 supportedBands.clear();
758 Q_FOREACH (const uint cap, qdbus_cast<QList<uint>>(*it)) {
759 supportedBands << ((MMModemBand)cap);
760 }
761 Q_EMIT q->supportedBandsChanged(supportedBands);
762 }
763 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_CURRENTBANDS));
764 if (it != changedProps.constEnd()) {
765 currentBands.clear();
766 Q_FOREACH (const uint cap, qdbus_cast<QList<uint>>(*it)) {
767 currentBands << ((MMModemBand)cap);
768 }
769 Q_EMIT q->currentBandsChanged(currentBands);
770 }
771 it = changedProps.constFind(QLatin1String(MM_MODEM_PROPERTY_SUPPORTEDIPFAMILIES));
772 if (it != changedProps.constEnd()) {
773 supportedIpFamilies = (ModemManager::Modem::IpBearerFamilies)it->toUInt();
774 Q_EMIT q->supportedIpFamiliesChanged(supportedIpFamilies);
775 }
776 }
777}
778
779void ModemManager::ModemPrivate::onStateChanged(int oldState, int newState, uint reason)
780{
781 Q_Q(Modem);
782 state = (MMModemState)newState;
783 Q_EMIT q->stateChanged((MMModemState)oldState, (MMModemState)newState, (MMModemStateChangeReason)reason);
784}
785
786#include "moc_modem.cpp"
787#include "moc_modem_p.cpp"
This class represents bearer properties used for creating of new bearers.
Definition modem.h:34
QString password() const
Returns password.
Definition modem.cpp:100
QString apn() const
Returns Access Point Name.
Definition modem.cpp:60
~BearerProperties()
Destroys this BearerProperties object.
Definition modem.cpp:55
QString number() const
Returns telephone number to dial.
Definition modem.cpp:130
MMModemCdmaRmProtocol rmProtocol() const
Returns protocol of the Rm interface.
Definition modem.cpp:120
void setAllowedAuthentication(MMBearerAllowedAuth allowedAuth)
Sets the authentication method to use.
Definition modem.cpp:85
void setPassword(const QString &password)
Sets password.
Definition modem.cpp:105
bool allowRoaming() const
Returns whether connection is allowed during roaming.
Definition modem.cpp:110
BearerProperties()
Constructs an empty BearerProperties object.
Definition modem.cpp:44
void setApn(const QString &apn)
Sets Access Point Name.
Definition modem.cpp:65
BearerProperties & operator=(const BearerProperties &other)
Makes a copy of the IpConfig object other.
Definition modem.cpp:140
void setUser(const QString &user)
Sets user name.
Definition modem.cpp:95
MMBearerAllowedAuth allowedAuthentication() const
Returns used authentication method.
Definition modem.cpp:80
QString user() const
Returns user name.
Definition modem.cpp:90
MMBearerIpFamily ipType() const
Returns addressing type.
Definition modem.cpp:70
void setRmProtocol(MMModemCdmaRmProtocol rmProtocol)
Sets protocol of the Rm interface.
Definition modem.cpp:125
void setAllowRoaming(bool allow)
Sets whether connection is allowed during roaming.
Definition modem.cpp:115
void setNumber(const QString &number)
Sets telephone number to dial.
Definition modem.cpp:135
void setIpType(MMBearerIpFamily ipType)
Sets addressing type.
Definition modem.cpp:75
The Bearer class.
Definition bearer.h:131
The Modem class.
Definition modem.h:147
ModemManager::Bearer::Ptr findBearer(const QString &bearer) const
Definition modem.cpp:338
MMModemState state() const
Definition modem.cpp:492
QString device() const
Definition modem.cpp:444
IpBearerFamilies supportedIpFamilies() const
Definition modem.cpp:552
SupportedModesType supportedModes() const
Definition modem.cpp:528
QDBusPendingReply< void > setEnabled(bool enable)
Enable or disable the modem.
Definition modem.cpp:283
CurrentModesType currentModes() const
Definition modem.cpp:534
QString manufacturer() const
Definition modem.cpp:420
QString plugin() const
Definition modem.cpp:456
PortList ports() const
Definition modem.cpp:468
bool isEnabled() const
Definition modem.cpp:271
ModemManager::Bearer::List listBearers() const
Definition modem.cpp:322
QList< MMModemBand > currentBands() const
Definition modem.cpp:546
QDBusPendingReply< void > reset()
Clear non-persistent configuration and state, and return the device to a newly-powered-on state.
Definition modem.cpp:344
MMModemLock unlockRequired() const
Definition modem.cpp:480
QString revision() const
Definition modem.cpp:432
uint maxBearers() const
Definition modem.cpp:408
QStringList ownNumbers() const
Definition modem.cpp:516
QDBusPendingReply< void > factoryReset(const QString &code)
Clear the modem's configuration (including persistent configuration and state), and return the device...
Definition modem.cpp:350
QString equipmentIdentifier() const
Definition modem.cpp:474
QDBusPendingReply< void > setPowerState(MMModemPowerState state)
Set the power state of the modem.
Definition modem.cpp:356
uint maxActiveBearers() const
Definition modem.cpp:414
MMModemStateFailedReason stateFailedReason() const
Definition modem.cpp:498
void setTimeout(int timeout)
Sets the timeout in milliseconds for all async method DBus calls.
Definition modem.cpp:577
QStringList drivers() const
Definition modem.cpp:450
AccessTechnologies accessTechnologies() const
Definition modem.cpp:504
UnlockRetriesMap unlockRetries() const
Definition modem.cpp:486
int timeout() const
Returns the current value of the DBus timeout in milliseconds.
Definition modem.cpp:583
QList< MMModemBand > supportedBands() const
Definition modem.cpp:540
QDBusPendingReply< void > setCurrentCapabilities(Capabilities caps)
Set the capabilities of the device.
Definition modem.cpp:362
QString deviceIdentifier() const
Definition modem.cpp:438
QString simPath() const
Definition modem.cpp:390
QString primaryPort() const
Definition modem.cpp:462
QDBusPendingReply< QDBusObjectPath > createBearer(const ModemManager::BearerProperties &bearerProperties)
Create a new packet data bearer using the given characteristics.
Definition modem.cpp:289
QDBusPendingReply< void > setCurrentModes(const CurrentModesType &mode)
Set the access technologies (e.g.
Definition modem.cpp:368
Capabilities currentCapabilities() const
Definition modem.cpp:402
SignalQualityPair signalQuality() const
Definition modem.cpp:510
QDBusPendingReply< void > setCurrentBands(const QList< MMModemBand > &bands)
Set the radio frequency and technology bands the device is currently allowed to use when connecting t...
Definition modem.cpp:374
MMModemPowerState powerState() const
Definition modem.cpp:522
QDBusPendingReply< void > deleteBearer(const QString &bearer)
Delete an existing packet data bearer.
Definition modem.cpp:316
QList< MMModemCapability > supportedCapabilities() const
Definition modem.cpp:396
QString model() const
Definition modem.cpp:426
QString path(const QString &relativePath)
This namespace allows to query the underlying system to discover the available modem interfaces respo...
Definition bearer.cpp:20
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
QDBusConnection sessionBus()
QDBusConnection systemBus()
QString path() const const
bool isValid() const const
typename Select< 0 >::Type value() const const
void append(QList< T > &&value)
bool isEmpty() const const
void remove(qsizetype i, qsizetype n)
bool removeOne(const AT &t)
void deleteLater()
bool isEmpty() const const
QString number(double n, char format, int precision)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.