ModemManagerQt

modemsimple.h
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#ifndef MODEMMANAGERQT_MODEM_SIMPLE_H
8#define MODEMMANAGERQT_MODEM_SIMPLE_H
9
10#include <ModemManager/ModemManager.h>
11
12#include <modemmanagerqt_export.h>
13
14#include "generictypes.h"
15#include "interface.h"
16
17#include <QDBusPendingReply>
18
19namespace ModemManager
20{
21class ModemSimplePrivate;
22
23/**
24 * @brief The ModemSimple class
25 *
26 * The Simple interface allows controlling and querying the status of Modems.
27 */
28class MODEMMANAGERQT_EXPORT ModemSimple : public Interface
29{
30 Q_OBJECT
31 Q_DECLARE_PRIVATE(ModemSimple)
32
33public:
35 typedef QList<Ptr> List;
36
37 explicit ModemSimple(const QString &path, QObject *parent = nullptr);
38 ~ModemSimple() override;
39
40 QString uni() const;
41
42 /**
43 * Do everything needed to connect the modem using the given properties.
44 *
45 * This method will attempt to find a matching packet data bearer and activate it if necessary,
46 * returning the bearer's IP details. If no matching bearer is found, a new bearer will be created
47 * and activated, but this operation may fail if no resources are available to complete this connection
48 * attempt (ie, if a conflicting bearer is already active).
49 *
50 * This call may make a large number of changes to modem configuration based on properties passed in. For
51 * example, given a PIN-locked, disabled GSM/UMTS modem, this call may unlock the SIM PIN, alter the access
52 * technology preference, wait for network registration (or force registration to a specific provider), create
53 * a new packet data bearer using the given "apn", and connect that bearer.
54 *
55 * Dictionary of properties needed to get the modem connected.
56 * Each implementation is free to add its own specific key-value pairs. The predefined
57 * common ones are:
58 *
59 * @param pin SIM-PIN unlock code, given as a string value (signature "s").
60 * @param operator-id ETSI MCC-MNC of a network to force registration with, given as a string value (signature "s").
61 * @param apn For GSM/UMTS and LTE devices the APN to use, given as a string value (signature "s").
62 * @param ip-type For GSM/UMTS and LTE devices the IP addressing type to use, given as a MMBearerIpFamily value (signature "u").
63 * @param allowed-auth The authentication method to use, given as a MMBearerAllowedAuth value (signature "u"). Optional in 3GPP.
64 * @param user User name (if any) required by the network, given as a string value (signature "s"). Optional in 3GPP.
65 * @param password Password (if any) required by the network, given as a string value (signature "s"). Optional in 3GPP.
66 * @param number For POTS devices the number to dial,, given as a string value (signature "s").
67 * @param allow-roaming FALSE to allow only connections to home networks, given as a boolean value (signature "b").
68 * @param rm-protocol For CDMA devices, the protocol of the Rm interface, given as a MMModemCdmaRmProtocol value (signature "u").
69 *
70 * @return On successful connect, returns the object path of the connected packet data bearer used for the connection attempt.
71 */
72 QDBusPendingReply<QDBusObjectPath> connectModem(const QVariantMap &properties);
73
74 /**
75 * Dictionary of properties.
76 * Each implementation is free to add it's own specific key-value pairs. The predefined
77 * common ones are:
78 *
79 * @param state A MMModemState value specifying the overall state of the modem, given as an unsigned integer value (signature "u").
80 * @param signal-quality Signal quality value, given only when registered, as an unsigned integer value (signature "u").
81 * @param current-bands List of MMModemBand values, given only when registered, as a list of unsigned integer values (signature "au").
82 * @param access-technology A MMModemAccessTechnology value, given only when registered, as an unsigned integer value (signature "u").
83 * @param m3gpp-registration-state A MMModem3gppRegistrationState value specifying the state of the registration,
84 * given only when registered in a 3GPP network, as an unsigned integer value (signature "u").
85 * @param m3gpp-operator-code Operator MCC-MNC, given only when registered in a 3GPP network, as a string value (signature "s").
86 * @param m3gpp-operator-name Operator name, given only when registered in a 3GPP network, as a string value (signature "s").
87 * @param cdma-cdma1x-registration-state A MMModemCdmaRegistrationState value specifying the state of the registration,
88 * given only when registered in a CDMA1x network, as an unsigned integer value (signature "u").
89 * @param cdma-evdo-registration-state A MMModemCdmaRegistrationState value specifying the state of the registration,
90 * given only when registered in a EV-DO network, as an unsigned integer value (signature "u").
91 * @param cdma-sid The System Identifier of the serving network, if registered in a CDMA1x network and if known.
92 * Given as an unsigned integer value (signature "u").
93 * @param cdma-nid The Network Identifier of the serving network, if registered in a CDMA1x network and if known.
94 * Given as an unsigned integer value (signature "u").
95 */
97
98 /**
99 * Disconnect an active packet data connection.
100 */
101 QDBusPendingReply<void> disconnectModem(const QString &bearer);
102
103 /**
104 * Convenient method calling disconnectModem with "/" to make ModemManager disconnect all modems
105 */
106 QDBusPendingReply<void> disconnectAllModems();
107
108 /**
109 * Sets the timeout in milliseconds for all async method DBus calls.
110 * -1 means the default DBus timeout (usually 25 seconds).
111 */
112 void setTimeout(int timeout);
113
114 /**
115 * Returns the current value of the DBus timeout in milliseconds.
116 * -1 means the default DBus timeout (usually 25 seconds).
117 */
118 int timeout() const;
119};
120
121} // namespace ModemManager
122
123#endif
The ModemSimple class.
Definition modemsimple.h:29
This namespace allows to query the underlying system to discover the available modem interfaces respo...
Definition bearer.cpp:20
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.