ModemManagerQt

modemsimple.cpp
1/*
2 SPDX-FileCopyrightText: 2015 Jan Grulich <jgrulich@redhat.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "modemsimple_p.h"
8
9#include "mmdebug_p.h"
10#ifdef MMQT_STATIC
11#include "dbus/fakedbus.h"
12#else
13#include "dbus/dbus.h"
14#endif
15
16ModemManager::ModemSimplePrivate::ModemSimplePrivate(const QString &path, ModemSimple *q)
17 : InterfacePrivate(path, q)
18#ifdef MMQT_STATIC
19 , modemSimpleIface(QLatin1String(MMQT_DBUS_SERVICE), path, QDBusConnection::sessionBus())
20#else
21 , modemSimpleIface(QLatin1String(MMQT_DBUS_SERVICE), path, QDBusConnection::systemBus())
22#endif
23 , q_ptr(q)
24{
25}
26
27ModemManager::ModemSimple::ModemSimple(const QString &path, QObject *parent)
28 : Interface(*new ModemSimplePrivate(path, this), parent)
29{
30}
31
32ModemManager::ModemSimple::~ModemSimple()
33{
34}
35
36QString ModemManager::ModemSimple::uni() const
37{
38 Q_D(const ModemSimple);
39 return d->uni;
40}
41
43{
45
46 return d->modemSimpleIface.Connect(properties);
47}
48
50{
52 return d->modemSimpleIface.GetStatus();
53}
54
56{
58 return d->modemSimpleIface.Disconnect(QDBusObjectPath(bearer));
59}
60
62{
63 return disconnectModem(QStringLiteral("/"));
64}
65
67{
69 d->modemSimpleIface.setTimeout(timeout);
70}
71
73{
74 Q_D(const ModemSimple);
75 return d->modemSimpleIface.timeout();
76}
77
78#include "moc_modemsimple.cpp"
79#include "moc_modemsimple_p.cpp"
The ModemSimple class.
Definition modemsimple.h:29
QDBusPendingReply< void > disconnectAllModems()
Convenient method calling disconnectModem with "/" to make ModemManager disconnect all modems.
QDBusPendingReply< void > disconnectModem(const QString &bearer)
Disconnect an active packet data connection.
int timeout() const
Returns the current value of the DBus timeout in milliseconds.
QDBusPendingReply< QVariantMap > getStatus()
Dictionary of properties.
QDBusPendingReply< QDBusObjectPath > connectModem(const QVariantMap &properties)
Do everything needed to connect the modem using the given properties.
void setTimeout(int timeout)
Sets the timeout in milliseconds for all async method DBus calls.
QString path(const QString &relativePath)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.