ModemManagerQt

modemoma.h
1/*
2 SPDX-FileCopyrightText: 2014 Lukas Tinkl <ltinkl@redhat.com>
3 SPDX-FileCopyrightText: 2015 Jan Grulich <jgrulich@redhat.com>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#ifndef MODEMMANAGERQT_MODEMOMA_H
9#define MODEMMANAGERQT_MODEMOMA_H
10
11#include <modemmanagerqt_export.h>
12
13#include <QDBusPendingReply>
14#include <QObject>
15#include <QSharedPointer>
16
17#include "generictypes.h"
18#include "interface.h"
19
20namespace ModemManager
21{
22class ModemOmaPrivate;
23
24/**
25 * @brief The ModemManager Open Mobile Alliance interface.
26 *
27 * This interface allows clients to handle device management operations as specified by the Open Mobile Alliance (OMA).
28 *
29 * Device management sessions are either on-demand (client-initiated), or automatically initiated by either the device
30 * itself or the network.
31 *
32 * @since 1.1.92
33 */
34class MODEMMANAGERQT_EXPORT ModemOma : public Interface
35{
36 Q_OBJECT
37 Q_DECLARE_PRIVATE(ModemOma)
38 Q_FLAGS(MMOmaFeature)
39
40public:
42 typedef QList<Ptr> List;
43
44 Q_DECLARE_FLAGS(Features, MMOmaFeature)
45
46 explicit ModemOma(const QString &path, QObject *parent = nullptr);
47 ~ModemOma() override;
48
49 // properties
50 /**
51 * @return MMOmaFeature flags, specifying which device management features are enabled or disabled
52 */
53 Features features() const;
54
55 /**
56 * @return list of network-initiated sessions which are waiting to be accepted or rejected, where:
57 * @param the first integer is a MMOmaSessionType
58 * @param the second integer is the unique session ID.
59 */
60 OmaSessionTypes pendingNetworkInitiatedSessions() const;
61
62 /**
63 * @return type of the current on-going device management session, given as a MMOmaSessionType
64 */
65 MMOmaSessionType sessionType() const;
66
67 /**
68 * @return state of the current on-going device management session, given as a MMOmaSessionState
69 */
70 MMOmaSessionState sessionState() const;
71
72 // methods
73 /**
74 * Configures which OMA device management features should be enabled.
75 *
76 * @param features MMModemOmaFeature flags, specifying which device management features should get enabled or disabled.
77 * MM_OMA_FEATURE_NONE will disable all features.
78 */
79 QDBusPendingReply<void> setup(Features features);
80
81 /**
82 * Starts a client-initiated device management session.
83 *
84 * @param sessionType type of client-initiated device management session,given as a MMOmaSessionType
85 */
86 QDBusPendingReply<void> startClientInitiatedSession(MMOmaSessionType sessionType);
87
88 /**
89 * Accepts or rejects a network-initiated device management session.
90 *
91 * @param sessionId unique ID of the network-initiated device management session
92 * @param accept boolean specifying whether the session is accepted or rejected
93 */
94 QDBusPendingReply<void> acceptNetworkInitiatedSession(uint sessionId, bool accept);
95
96 /**
97 * Cancels the current on-going device management session.
98 */
99 QDBusPendingReply<void> cancelSession();
100
101 /**
102 * Sets the timeout in milliseconds for all async method DBus calls.
103 * -1 means the default DBus timeout (usually 25 seconds).
104 */
105 void setTimeout(int timeout);
106
107 /**
108 * Returns the current value of the DBus timeout in milliseconds.
109 * -1 means the default DBus timeout (usually 25 seconds).
110 */
111 int timeout() const;
112
113Q_SIGNALS:
114 void featuresChanged(QFlags<MMOmaFeature> features);
115 void pendingNetworkInitiatedSessionsChanged(const ModemManager::OmaSessionTypes &sessions);
116 void sessionTypeChanged(MMOmaSessionType sessionType);
117 /**
118 * Emitted when the session state changed.
119 *
120 * @param oldState previous session state, given as a MMOmaSessionState
121 * @param newState current session state, given as a MMOmaSessionState
122 * @param failedReason reason of failure, given as a MMOmaSessionStateFailedReason, if sessionState() is MM_OMA_SESSION_STATE_FAILED
123 */
124 void sessionStateChanged(MMOmaSessionState oldState, MMOmaSessionState newState, MMOmaSessionStateFailedReason failedReason);
125};
126
127} // namespace ModemManager
128
129#endif
The ModemManager Open Mobile Alliance interface.
Definition modemoma.h:35
void sessionStateChanged(MMOmaSessionState oldState, MMOmaSessionState newState, MMOmaSessionStateFailedReason failedReason)
Emitted when the session state changed.
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 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.