2
Copyright 2008 Will Stephenson <wstephenson@kde.org>
3
Copyright 2010 Lamarque Souza <lamarque@gmail.com>
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of
7
the License or (at your option) version 3 or any later version
8
accepted by the membership of KDE e.V. (or its successor approved
9
by the membership of KDE e.V.), which shall act as a proxy
10
defined in Section 14 of version 3 of the license.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
22
#include "modemcdmainterface.h"
23
#include "modemcdmainterface_p.h"
27
MMModemCdmaInterfacePrivate::MMModemCdmaInterfacePrivate(const QString &path, QObject *owner)
28
: MMModemInterfacePrivate(path, owner), modemCdmaIface(MMModemManager::DBUS_SERVICE, path, QDBusConnection::systemBus())
32
MMModemCdmaInterface::MMModemCdmaInterface(const QString & path, MMModemManager * manager, QObject * parent)
33
: MMModemInterface(*new MMModemCdmaInterfacePrivate(path, this), manager, parent)
35
Q_D(MMModemCdmaInterface);
37
connect( &d->modemCdmaIface, SIGNAL(RegistrationStateChanged(const Solid::Control::ModemCdmaInterface::RegistrationState,
38
const Solid::Control::ModemCdmaInterface::RegistrationState)),
39
this, SIGNAL(registrationStateChanged(const Solid::Control::ModemCdmaInterface::RegistrationState,
40
const Solid::Control::ModemCdmaInterface::RegistrationState)));
41
connect( &d->modemCdmaIface, SIGNAL(SignalQuality(uint)),
42
this, SIGNAL(signalQualityChanged(uint)));
45
MMModemCdmaInterface::~MMModemCdmaInterface()
50
uint MMModemCdmaInterface::getSignalQuality()
52
Q_D(MMModemCdmaInterface);
53
QDBusReply< uint > signalQuality = d->modemCdmaIface.GetSignalQuality();
55
if (signalQuality.isValid())
56
return signalQuality.value();
58
kDebug(1441) << "Error getting signal quality: " << signalQuality.error().name() << ": " << signalQuality.error().message();
62
QString MMModemCdmaInterface::getEsn()
64
Q_D(MMModemCdmaInterface);
65
QDBusReply<QString> esn = d->modemCdmaIface.GetEsn();
70
kDebug(1441) << "Error getting ESN: " << esn.error().name() << ": " << esn.error().message();
74
ServingSystemType MMModemCdmaInterface::getServingSystem()
76
Q_D(MMModemCdmaInterface);
77
QDBusReply<ServingSystemType> servingSystem = d->modemCdmaIface.GetServingSystem();
79
if (servingSystem.isValid())
80
return servingSystem.value();
82
kDebug(1441) << "Error getting serving system info: " << servingSystem.error().name() << ": " << servingSystem.error().message();
83
return ServingSystemType();
86
RegistrationStateResult MMModemCdmaInterface::getRegistrationState()
88
Q_D(MMModemCdmaInterface);
89
QDBusReply<RegistrationStateResult> registrationState = d->modemCdmaIface.GetRegistrationState();
91
if (registrationState.isValid())
92
return registrationState.value();
94
kDebug(1441) << "Error getting registration state: " << registrationState.error().name() << ": " << registrationState.error().message();
95
return RegistrationStateResult();
98
#include "modemcdmainterface.moc"