ModemManagerQt

modem3gpp.h
1/*
2 SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org>
3 SPDX-FileCopyrightText: 2010 Lamarque Souza <lamarque@kde.org>
4 SPDX-FileCopyrightText: 2013 Lukas Tinkl <ltinkl@redhat.com>
5 SPDX-FileCopyrightText: 2013-2015 Jan Grulich <jgrulich@redhat.com>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
8*/
9
10#ifndef MODEMMANAGERQT_MODEM3GPP_H
11#define MODEMMANAGERQT_MODEM3GPP_H
12
13#include <modemmanagerqt_export.h>
14
15#include <QDBusPendingReply>
16#include <QObject>
17#include <QSharedPointer>
18
19#include "generictypes.h"
20#include "interface.h"
21
22namespace ModemManager
23{
24class Modem3gppPrivate;
25
26/**
27 * @brief The Modem3gpp class
28 *
29 * This class provides access to specific actions that may be performed in modems with 3GPP capabilities.
30 */
31class MODEMMANAGERQT_EXPORT Modem3gpp : public Interface
32{
33 Q_OBJECT
34 Q_DECLARE_PRIVATE(Modem3gpp)
35 Q_FLAGS(MMModem3gppFacility)
36
37public:
39 typedef QList<Ptr> List;
40
41 Q_DECLARE_FLAGS(FacilityLocks, MMModem3gppFacility)
42
43 explicit Modem3gpp(const QString &path, QObject *parent = nullptr);
44 ~Modem3gpp() override;
45
46 /**
47 * @return the IMEI of the device
48 */
49 QString imei() const;
50
51 /**
52 * @return mobile registration status as defined in 3GPP TS 27.007 section 10.1.19
53 */
54 MMModem3gppRegistrationState registrationState() const;
55
56 /**
57 * @return code of the operator to which the mobile is currently registered.
58 *
59 * Returned in the format "MCCMNC", where MCC is the three-digit ITU E.212
60 * Mobile Country Code and MNC is the two- or three-digit GSM Mobile Network
61 * Code. e.g. e"31026" or "310260".
62 *
63 * If the MCC and MNC are not known or the mobile is not registered to a
64 * mobile network, this property will be an empty string.
65 */
66 QString operatorCode() const;
67
68 /**
69 * @return name of the operator to which the mobile is currently registered.
70 *
71 * If the operator name is not known or the mobile is not registered to a
72 * mobile network, this property will be an empty string.
73 */
74 QString operatorName() const;
75
76 /**
77 * @return country code of the operator to which the mobile is currently registered.
78 *
79 * Returned in the format "ISO 3166-1 alpha-2" according to the MMC mapping from Wikipedia.
80 * Country Code is the two-letter country codes defined in ISO 3166-1, part of the ISO 3166 standard,
81 * e.g. "RU" or "FI".
82 *
83 * If the MCC is not known or the mobile is not registered to a
84 * mobile network, this property will be an empty string.
85 */
86 QString countryCode() const;
87
88 /**
89 * @return QFlags of MMModem3gppFacility values for which PIN locking is enabled
90 */
91 FacilityLocks enabledFacilityLocks() const;
92
93#if MM_CHECK_VERSION(1, 2, 0)
94 /**
95 * @return Value representing the subscription status of the account and whether there is any data remaining.
96 */
97 MMModem3gppSubscriptionState subscriptionState() const;
98#endif
99 /**
100 * Register the device to network.
101 *
102 * @param networkId The operator ID (ie, "MCCMNC", like "310260") to register. An empty string can be used to register to the home network.
103 */
104 void registerToNetwork(const QString &networkId = QString());
105
106 /**
107 * Scan for available networks.
108 *
109 * @return a QList<QVariantMap> with the results, where each map may contain these values:
110 *
111 * "status": A MMModem3gppNetworkAvailability value representing network
112 * availability status, given as an unsigned integer (signature "u"). This
113 * key will always be present.
114 *
115 * "operator-long": Long-format name of operator, given as a string value
116 * (signature "s"). If the name is unknown, this field should not be present.
117 *
118 * "operator-short": Short-format name of operator, given as a string value
119 * (signature "s"). If the name is unknown, this field should not be present.
120 *
121 * "operator-code": Mobile code of the operator, given as a string value
122 * (signature "s"). Returned in the format "MCCMNC", where MCC is the
123 * three-digit ITU E.212 Mobile Country Code and MNC is the two- or
124 * three-digit GSM Mobile Network Code. e.g. "31026" or "310260".
125 *
126 * "access-technology": A MMModemAccessTechnology value representing the
127 * generic access technology used by this mobile network, given as an
128 * unsigned integer (signature "u").
129 */
131
132 /**
133 * Sets the timeout in milliseconds for all async method DBus calls.
134 * -1 means the default DBus timeout (usually 25 seconds).
135 */
136 void setTimeout(int timeout);
137
138 /**
139 * Returns the current value of the DBus timeout in milliseconds.
140 * -1 means the default DBus timeout (usually 25 seconds).
141 */
142 int timeout() const;
143
144Q_SIGNALS:
145 void imeiChanged(const QString &imei);
146 void registrationStateChanged(MMModem3gppRegistrationState registrationState);
147 void operatorCodeChanged(const QString &operatorCode);
148 void operatorNameChanged(const QString &operatorName);
149 void countryCodeChanged(const QString &countryCode);
150 void enabledFacilityLocksChanged(QFlags<MMModem3gppFacility> locks);
151 void subscriptionStateChanged(MMModem3gppSubscriptionState subscriptionState);
152};
153
154Q_DECLARE_OPERATORS_FOR_FLAGS(Modem3gpp::FacilityLocks)
155
156} // namespace ModemManager
157
158#endif
The Modem3gpp class.
Definition modem3gpp.h:32
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 Tue Mar 26 2024 11:17:51 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.