File indexing completed on 2024-04-28 15:32:58

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 <QObject>
0014 #include <QSharedPointer>
0015 
0016 namespace ModemManager
0017 {
0018 class ModemFirmwarePrivate;
0019 
0020 /**
0021  * @brief The ModemFirmware class
0022  *
0023  * This class allows clients to select or install firmware images on modems.
0024  *
0025  * Firmware slots and firmware images are identified by arbitrary opaque strings.
0026  *
0027  * @since 1.1.94
0028  */
0029 class MODEMMANAGERQT_EXPORT ModemFirmware : public Interface
0030 {
0031     Q_OBJECT
0032     Q_DECLARE_PRIVATE(ModemFirmware)
0033 
0034 public:
0035     typedef QSharedPointer<ModemFirmware> Ptr;
0036     typedef QList<Ptr> List;
0037 
0038     explicit ModemFirmware(const QString &path, QObject *parent = nullptr);
0039     ~ModemFirmware() override;
0040 
0041     /**
0042      * List installed firmware images.
0043      *
0044      * Depending on the type of modem, installed images may be stored on the host or the modem.
0045      * Installed images can be selected non-destructively.
0046      *
0047      * @return @param selected (QString)
0048      *         The unique name of the selected firmware image, or the empty string if no image is selected.
0049      *         @param installed (QVariantMapList)
0050      *         A map of dictionaries containing the properties of the installed firmware images.
0051      */
0052     QDBusPendingReply<QString, QVariantMapList> listImages();
0053 
0054     /**
0055      * Selects a different firmware image to use, and immediately resets the modem so that it
0056      * begins using the new firmware image.
0057      *
0058      * The method will fail if the identifier does not match any of the names returned by listImages(),
0059      * or if the image could not be selected for some reason.
0060      *
0061      * @param uniqueid The unique ID of the firmware image to select.
0062      */
0063     void selectImage(const QString &uniqueid);
0064 };
0065 
0066 } // namespace ModemManager
0067 
0068 #endif