File indexing completed on 2025-02-16 13:12:30
0001 /* 0002 SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org> 0003 SPDX-FileCopyrightText: 2010 Lamarque Souza <lamarque@kde.org> 0004 SPDX-FileCopyrightText: 2013 Lukas Tinkl <ltinkl@redhat.com> 0005 SPDX-FileCopyrightText: 2013-2015 Jan Grulich <jgrulich@redhat.com> 0006 0007 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0008 */ 0009 0010 #ifndef MODEMMANAGERQT_MODEMCDMA_H 0011 #define MODEMMANAGERQT_MODEMCDMA_H 0012 0013 #include <modemmanagerqt_export.h> 0014 0015 #include <QObject> 0016 #include <QSharedPointer> 0017 #include <QVariant> 0018 0019 #include "generictypes.h" 0020 #include "interface.h" 0021 0022 namespace ModemManager 0023 { 0024 class ModemCdmaPrivate; 0025 0026 /** 0027 * @brief The ModemCdma class 0028 * 0029 * This class provides access to specific actions that may be performed in modems with CDMA capabilities. 0030 */ 0031 class MODEMMANAGERQT_EXPORT ModemCdma : public Interface 0032 { 0033 Q_OBJECT 0034 Q_DECLARE_PRIVATE(ModemCdma) 0035 public: 0036 typedef QSharedPointer<ModemCdma> Ptr; 0037 typedef QList<Ptr> List; 0038 0039 explicit ModemCdma(const QString &path, QObject *parent = nullptr); 0040 ~ModemCdma() override; 0041 0042 /** 0043 * Provisions the modem for use with a given carrier using the modem's 0044 * Over-The-Air (OTA) activation functionality, if any. 0045 * 0046 * Some modems will reboot after this call is made. 0047 * 0048 * @param carrierCode name of carrier, or carrier-specific code 0049 */ 0050 QDBusPendingReply<void> activate(const QString &carrierCode); 0051 0052 /** 0053 * Sets the modem provisioning data directly, without contacting the carrier over the air. 0054 * 0055 * Some modems will reboot after this call is made. 0056 * 0057 * @param properties QVariantMap consisting of: 0058 * 0059 * "spc": The Service Programming Code, given as a string of exactly 6 digit characters. Mandatory parameter. 0060 * "sid": The System Identification Number, given as a 16-bit unsigned integer (signature "q"). Mandatory parameter. 0061 * "mdn": The Mobile Directory Number, given as a string of maximum 15 characters. Mandatory parameter. 0062 * "min": The Mobile Identification Number, given as a string of maximum 15 characters. Mandatory parameter. 0063 * "mn-ha-key": The MN-HA key, given as a string of maximum 16 characters. 0064 * "mn-aaa-key": The MN-AAA key, given as a string of maximum 16 characters. 0065 * "prl": The Preferred Roaming List, given as an array of maximum 16384 bytes. 0066 */ 0067 QDBusPendingReply<void> activateManual(const QVariantMap &properties); 0068 0069 /** 0070 * @return a MMModemCdmaActivationState value specifying the state of the activation in the 3GPP2 network. 0071 */ 0072 MMModemCdmaActivationState activationState() const; 0073 0074 /** 0075 * @return the modem's Mobile Equipment Identifier. 0076 */ 0077 QString meid() const; 0078 0079 /** 0080 * @return the modem's Electronic Serial Number (superseded by MEID but still used by older devices). 0081 */ 0082 QString esn() const; 0083 0084 /** 0085 * @return the System Identifier of the serving CDMA 1x network, if known, and if the modem is registered with a CDMA 1x network. 0086 * @see http://ifast.org or the mobile broadband provider database for mappings of SIDs to network providers. 0087 */ 0088 uint sid() const; 0089 0090 /** 0091 * @return the Network Identifier of the serving CDMA 1x network, if known, and if the modem is registered with a CDMA 1x network. 0092 */ 0093 uint nid() const; 0094 0095 /** 0096 * @return a MMModemCdmaRegistrationState value specifying the CDMA 1x registration state. 0097 */ 0098 MMModemCdmaRegistrationState cdma1xRegistrationState() const; 0099 0100 /** 0101 * @return a MMModemCdmaRegistrationState value specifying the EVDO registration state. 0102 */ 0103 MMModemCdmaRegistrationState evdoRegistrationState() const; 0104 0105 /** 0106 * Sets the timeout in milliseconds for all async method DBus calls. 0107 * -1 means the default DBus timeout (usually 25 seconds). 0108 */ 0109 void setTimeout(int timeout); 0110 0111 /** 0112 * Returns the current value of the DBus timeout in milliseconds. 0113 * -1 means the default DBus timeout (usually 25 seconds). 0114 */ 0115 int timeout() const; 0116 0117 Q_SIGNALS: 0118 /** 0119 * This signal is emitted when the activation info this network changes 0120 * 0121 * @param state current activation state, given as a MMModemCdmaActivationState. 0122 * @param error carrier-specific error code, given as a MMCdmaActivationError. 0123 * @param status_changes properties that have changed as a result of this activation state change, including "mdn" and "min". 0124 * The map may be empty if the changed properties are unknown. 0125 */ 0126 void activationStateChanged(MMModemCdmaActivationState state, MMCdmaActivationError error, const QVariantMap &status_changes); 0127 void meidChanged(const QString &meid); 0128 void esnChanged(const QString &esn); 0129 void sidChanged(uint sid); 0130 void nidChanged(uint nid); 0131 void cdma1xRegistrationStateChanged(MMModemCdmaRegistrationState cdma1xRegistrationState); 0132 void evdoRegistrationStateChanged(MMModemCdmaRegistrationState evdoRegistrationState); 0133 }; 0134 } // namespace ModemManager 0135 0136 #endif