File indexing completed on 2024-04-14 03:57:24
0001 /* 0002 SPDX-FileCopyrightText: 2014 Lukas Tinkl <ltinkl@redhat.com> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #ifndef MODEMMANAGERQT_MODEMFIRMWARE_H 0008 #define MODEMMANAGERQT_MODEMFIRMWARE_H 0009 0010 #include "interface.h" 0011 #include <modemmanagerqt_export.h> 0012 0013 #include <QDBusPendingReply> 0014 #include <QObject> 0015 #include <QSharedPointer> 0016 0017 namespace ModemManager 0018 { 0019 class ModemFirmwarePrivate; 0020 0021 /** 0022 * @brief The ModemFirmware class 0023 * 0024 * This class allows clients to select or install firmware images on modems. 0025 * 0026 * Firmware slots and firmware images are identified by arbitrary opaque strings. 0027 * 0028 * @since 1.1.94 0029 */ 0030 class MODEMMANAGERQT_EXPORT ModemFirmware : public Interface 0031 { 0032 Q_OBJECT 0033 Q_DECLARE_PRIVATE(ModemFirmware) 0034 0035 public: 0036 typedef QSharedPointer<ModemFirmware> Ptr; 0037 typedef QList<Ptr> List; 0038 0039 explicit ModemFirmware(const QString &path, QObject *parent = nullptr); 0040 ~ModemFirmware() override; 0041 0042 /** 0043 * List installed firmware images. 0044 * 0045 * Depending on the type of modem, installed images may be stored on the host or the modem. 0046 * Installed images can be selected non-destructively. 0047 * 0048 * @return @param selected (QString) 0049 * The unique name of the selected firmware image, or the empty string if no image is selected. 0050 * @param installed (QVariantMapList) 0051 * A map of dictionaries containing the properties of the installed firmware images. 0052 */ 0053 QDBusPendingReply<QString, QVariantMapList> listImages(); 0054 0055 /** 0056 * Selects a different firmware image to use, and immediately resets the modem so that it 0057 * begins using the new firmware image. 0058 * 0059 * The method will fail if the identifier does not match any of the names returned by listImages(), 0060 * or if the image could not be selected for some reason. 0061 * 0062 * @param uniqueid The unique ID of the firmware image to select. 0063 */ 0064 void selectImage(const QString &uniqueid); 0065 }; 0066 0067 } // namespace ModemManager 0068 0069 #endif